searchkick not returnign results with whitespaces

点点圈 提交于 2019-12-20 07:29:43

问题


so i have this searckick method:

search_options = {
  misspellings: { edit_distance: 2 },
  fields: [:eventname, :date, :city],
  order: { _score: :desc, date: :asc, eventname: :asc, city: :asc },
  match: :word_start,
  suggest: true,
  page: params[:page],
  per_page: 20
}
if params[:date_from].present?
  datefrom = params[:date_from].to_datetime.strftime('%Y-%m-%d')
  dateto = params[:date_to].to_datetime.strftime('%Y-%m-%d')
  search_options[:where] =  { date: {gte: datefrom, lte: dateto} }
end

This isn't working with whitespaces.... e.g. bassjam isn't matching bass jam, if i search bass jam the results wanted return fine!

any ideas why this isn't working as expected?

Sam


回答1:


delete match: :word_start from the options



来源:https://stackoverflow.com/questions/46686905/searchkick-not-returnign-results-with-whitespaces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!