Searchkick: case insensitive search

Created on 13 Nov 2014  路  5Comments  路  Source: ankane/searchkick

It looks like search queries are case _sensitive_ by default. (Using 0.8.5)

results = Model.search('*', order: {label: :asc})
results.map(&:label)
#=> ["FIFID", "WWWWW", "souf", "structure", "xj123"]

Wondering what the best way to add this option is? I see a page in the ES docs describing how to create an analyzer for case sensitive search, but I'm not sure how that maps to Searchkick world.

Most helpful comment

Any news on how to accomplish this?

All 5 comments

Any news on how to accomplish this?

Wondering this as well. We're fine with case sensitive search but the results should really be sorted case insensitive.

Bump - most of our clients seem to want case-insensitive search/result-ranking

For clarity for future readers:

  1. Search is case-insensitive.
  2. Ordering is case-sensitive. Make it case-insensitive requires indexing an extra field as documented in the Elasticsearch link above. This is not something I'd like to support, so I'd suggest using custom mapping/searching if you need this.
Was this page helpful?
0 / 5 - 0 ratings