Why I'm getting 0 results when fuzziness is more than 2?

I'm using elastic search 7.6.2

I have index with the following mapping:

        "mappings": {
            "properties": {
                "content": {"type": "text"},
            }
        }

with 3 documents:

  1. michael jordan and scottie pippen - NBA is a professional basketball league in North America.
  2. michael jordan and scottie pippen - National Basketball Association
  3. michael jordan and scottie pippen

I'm running the following simple query:

  "query":{
              "bool":{
                 "must":[
                    {
                       "span_near":{
                          "clauses":[
                             {
                                "span_multi":{
                                   "match":{
                                      "fuzzy":{
                                         "content":{
                                            "value":"hael",
                                            "fuzziness":4
                                         }
                                      }
                                   }
                                }
                             },                           
                          ],
                          "slop":1,
                          "in_order": "true"
                       }
                    }
                 ]
              }
           }
    }

And I'm getting 0 results.

  1. Why I'm not getting results ? (The value hael has 3 missing letters, and the fuzziness is 4) ?
  2. What is the meaning of slop (at the end of the query) ? (It seems that it doesn't do nothing)

The maximum value for fuzziness that Elasticsearch supports is 2. I am surprised it does not return an error indicating this.

It is worth noting that the query you specified witha 4 letter string and fuzziness of 4 would (if there was not a limitation in place) match any word with 4 or less letters as well as a lot of words that are up to 4 characters longer assuming they contain some of the characters in the string. This would return very useful results.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.