Elasticsearch search query priority (full match -> substring -> fuzzy)

Viewed 467

I'm trying to make query sorted by elastic according to following priorities: firstly, it shows all results which are exact as search string. Then it show all results which have search string as the substring. And finally, it shows all fuzzy matches.

Example:

search: Infect

results:

  1. infect (exact match)

  2. infected people, infection is spreading, ... (substring)

  3. impacted smth, I fetched ... (fuzzy match)

0 Answers
Related