{
"query": {
"multi_match": {
"fields": [ "text", "title" ],
"query": "king”,
"fuzziness": "AUTO",
"type": "best_fields"
}
}
}’
The fuzziness parameter can be specified as:
• 0, 1, 2 — It is maximum allowed Levenshtein Edit Distance (or number of edits)
• AUTO — It generates an edit distance based on the length of the term. For lengths:
o 0..2 — must match exactly
o 3..5 — one edit allowed
o > 5 — two edits allowed
AUTO should generally be the preferred value for fuzziness.
multi_match query also supports fuzziness but only when executing with type best_fields ((_score will be calculated from single best matching field.) or most_fields (_score will be calculated from the combination of all the fields.):
In Elasticsearch, we generally use multi_match query that uses best_fields as its default type
best_fields is most useful when you are searching for multiple words best found in the same field.