Searchkick不使用whitepace

时间:2017-09-28 15:34:26

标签: ruby-on-rails searchkick

所以我有这个searckick方法:

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

这不适用于空格....例如bassjambass jam

不匹配

任何想法为什么?

萨姆

0 个答案:

没有答案