fuzzy(n)
type, where n
is the edit distance.
Fuzziness is supported for match and term queries.
fuzzy(n)
, this requirement is relaxed — tokens are matched if their Levenshtein distance, or edit distance, is less than or equal to n
.
Edit distance is a measure of how many single-character operations are needed to turn one string into another. The allowed operations are:
1
1
2
2
.fuzzy(0)
is the same as an exact token match.fuzzy
also supports prefix matching.
For instance, “runn” is a prefix of “running” because it matches the beginning of the token exactly. “rann” is a fuzzy prefix of “running” because it matches the
beginning within an edit distance of 1
.
To treat the query string as a prefix, set the second argument of fuzzy
to either t
or "true"
:
true
be double-quoted, i.e. fuzzy(1, "true")
.rann
AND the fuzzy prefix slee
”:
2
. Setting the third argument of fuzzy
to t
lowers the
cost of a transposition to 1
:
fuzzy
is f
, which
means fuzzy(1)
is equivalent to fuzzy(1, f, f)
.