Reputation: 83
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.
Upvotes: 1
Views: 2399
Reputation: 526
It's as simple as User.search "fresh honey", match: :phrase
now.
Upvotes: 3
Reputation: 870
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.
Upvotes: 3