Search code examples
c#.netelasticsearchfuzzy-search

Not working fuzzy logic when use the fuzzines.auto elasticsearch


I want it to return similar results when a word is typed in the search box, even if the word is wrong. For example, when I type "gpple" it should come up with "google". I use Fuzzines.Auto for this but it doesn't work. I am attaching the code I wrote, I would appreciate if you could help. thanks

enter image description here


Solution

  • In the doc QueryString query you must use fuzzy like this (adding operator ~ in the end term:

    {
      "query": {
        "query_string": {
          "fields": ["fields_name"], 
          "query": "searchtext~"
        }
      }
    }