I use fuzzing in my quries to completion suggester. It seems like min_length
and fuzziness
parameters of the query can't agree between each other.
The parameters are described in the docs
Example 1: "min_length": 5, "fuzziness": "AUTO:5,8"
-
query:
conte-
expected: query length is 6, we're expecting 1 correction (dash to be removed)
result:contemporary
is suggested, everything's ok -
query:
contempo--
expected: query length is 10, we're expecting 2 corrections
result: nothing is suggested, incorrect behaviour
Example 2: "min_length": 1, "fuzziness": "AUTO:2,5"
-
query:
co-
expected: query length is 3, we're expecting 1 correction
result:contemporary
andcheese
are suggested, we have 2 corrections in the cheese case -
query:
contempo--
expected: query length is 10, we're expecting 2 corrections
result:contemporary
is suggested, everything's ok
The problem is reproducible with ES 8.6.2 and 8.8.2.
My configuration is as follows. Mapping:
{
"mappings": {
"properties": {
"query": {
"type": "completion",
"analyzer": "autocomplete_analyzer",
"search_analyzer": "autocomplete_search_analyzer"
},
}
}
}
Query:
{
"suggest": {
"text-suggest": {
"prefix": "conte-",
"completion": {
"field": "query",
"fuzzy": {
"fuzziness": "AUTO:5,8",
"min_length": 5,
"unicode_aware": True
},
"size": 4
}
}
}
}
Could anyone help with the issue? Probably this needs a bug confirmation. I would appreciate any help!