Search code examples
ruby-on-railselasticsearchsearchkick

Searchkick / Elasticsearch exact match


I am using elasticsearch through searchkick

I have a field called "detail" thats analyzed using "standard" analyzer ... now just like in google we do "several words" search to get exact match .. can we do the same in searchkick? I am not looking for fields: [{detail: exact}, name] because then it will match the whole article ... just the term as a whole not individual words.


Solution

  • You need to use match_phrase: true. You can see it in elastic search documentation.

    But this feature not merged yet in searchkick. FYI: github pull request I think you can use monkey-patch for add feature to your project.