2
votes

I've just started looking into ElasticSearch and had some questions on the fuzzy query. Let's say I had a document like this:

{ "name": "Frankie's Hot Dogs" }

Using the fuzzy query, if I searched using the following parameters, I'd receive no results:

"fuzzy": {
  "name": {
    "value": "FRANKIES",
    "fuzziness": 2
  }
}

Is this the expected behavior? I thought that since the field was defaulted to the Standard Analyzer that the name field would be tokenized and lowercased to something like:

["frankie's", "hot", "dogs"]

So wouldn't searching through a fuzzy query automatically lowercase your search terms? Or is this not the case?

Finally, does anyone have any suggestions on querying the data so that FRANKIES would actually return a hit?

Thanks in advance.

1

1 Answers

2
votes

Use fuzzy_like_this query

 "query": {
    "fuzzy_like_this" : {
        "fields" : ["name"],
        "like_text" : "FRANKIES"
    }
}