| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 | [[query-dsl-fuzzy-query]]=== Fuzzy Querydeprecated[5.0.0, Will be removed in 6.0. Use match queries with fuzziness instead]The fuzzy query uses similarity based on Levenshtein edit distance.==== String fieldsThe `fuzzy` query generates all possible matching terms that are within  themaximum edit distance specified in `fuzziness` and then checks the termdictionary to find out which of those generated terms actually exist in theindex.Here is a simple example:[source,js]--------------------------------------------------GET /_search{    "query": {       "fuzzy" : { "user" : "ki" }    }}--------------------------------------------------// CONSOLEOr with more advanced settings:[source,js]--------------------------------------------------GET /_search{    "query": {        "fuzzy" : {            "user" : {                "value" :         "ki",                    "boost" :         1.0,                    "fuzziness" :     2,                    "prefix_length" : 0,                    "max_expansions": 100            }        }    }}--------------------------------------------------// CONSOLE[float]===== Parameters[horizontal]`fuzziness`::    The maximum edit distance. Defaults to `AUTO`. See <<fuzziness>>.`prefix_length`::    The number of initial characters which will not be ``fuzzified''. This    helps to reduce the number of terms which must be examined. Defaults    to `0`.`max_expansions`::    The maximum number of terms that the `fuzzy` query will expand to.    Defaults to `50`.WARNING: This query can be very heavy if `prefix_length` is set to `0` and if`max_expansions` is set to a high number. It could result in every term in theindex being examined!
 |