Should get same result if user searches for same word, different spelling(elasticsearch)

Viewed 17

For example, judgement and judgment are actually the same, but there is a difference in the spelling. But when the query is

{
   "query":{
      "match_phrase":{
         "name":{
            "query":"Judgement"
         }
      }
   }
}

Or

{
   "query":{
      "match_phrase":{
         "name":{
            "query":"Judgment"
         }
      }
   }
}

I should get the same result. How can I achieve this? Thank you.

1 Answers

You can use the fuzzy query to achieve your use-case, there are several params to customize the default behaviour of it.

Related