Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
An edit distance is the number of one-character changes needed to turn one term into another. These changes can include:
To find similar terms, the fuzzy
query creates a set of all possible variations, or expansions, of the search term within a specified edit distance. The query then returns exact matches for each expansion.
GET /_search
{ "query": { "fuzzy": { "user.id": { "value": "ki" } } } }
GET /_search
{ "query": { "fuzzy": { "user.id": { "value": "ki", "fuzziness": "AUTO", "max_expansions": 50, "prefix_length": 0, "transpositions": true, "rewrite": "constant_score_blended" } } } }
<field>
value
<field>
.
fuzziness
max_expansions
50
.
Warning
Avoid using a high value in the max_expansions
parameter, especially if the prefix_length
parameter value is 0
. High values in the max_expansions
parameter can cause poor performance due to the high number of variations examined.
prefix_length
0
.
transpositions
true
.
rewrite
rewrite
parameter.
Fuzzy queries will not be executed if search.allow_expensive_queries
is set to false.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4