In ES 7.4, I have created a simple index with default mapping.
There is a string field "authors". I have indexed a doc where "authors" is "Benjamin".
Now I use this query:
GET my_index/_search
{
"query": {
"fuzzy": {
"authors": {
"value":"<testvalue>",
"fuzziness": 2
}
}
}
}
I get a match for the following <testvalue>
:
Benjaman
enjaman
Benjamni
-
enjamni
(!)
But I got NO match for Banjaman
!
How does that match with the principle of Levenshtein distance?
Banjaman
has a distance of 2, just like e.g. enjamni
, so it is not logical.
By the way, transposition as in
-> ni
is not "pure" Levenshein distance, but a derived concept ("Damerau-Levenshtein distance"), this confused me a bit at first.