Fuzziness with Keyword and Text fields

"When querying text or keyword fields, fuzziness is interpreted as a Levenshtein Edit Distance"

Based on the above statement from Fuzziness Document, the query should work the same for both fields.
Please correct me if I'm wrong

here is how the Mapping goes, copying the same data to keyword field and text field

    "properties":{
            "id":{"type":"keyword"},
            "name":{"type":"keyword", "copy_to": ["name_factor_k", "name_factor_t"]},
            "accNames": {"type":"keyword", "copy_to": ["name_factor_k", "name_factor_t"]},
            "name_factor_k": {"type":"keyword"},
            "name_factor_t": {"type":"text"}
        }

Here is how my Query goes.
Query 1 with Keyword Field

    "query": {
    "match": {
      "name_factor_k": {
        "query": "youtube",
        "fuzziness": "AUTO",
        "operator": "AND"
      }
    }
  }

Query 2 with Text Field

 "query": {
    "match": {
      "name_factor_t": {
        "query": "youtube",
        "fuzziness": "AUTO",
        "operator": "AND"
      }
    }
  } 

I'm expecting same result for both query but only byText field is returning right result.

FYI:-
accNames: [ "YOUTUBE INC.", "GOOGLE WEB", "ALPHABET" and so on]

text fields do matching on individual words eg youtube or inc whereas keyword fields match the whole string value ie youtube inc.. You have to do more than 2 character changes (the max fuzziness) before youtube inc. is the same as the search string

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