-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Incorrect behaviour of fuzzing parameters with completion suggester #107707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pinging @elastic/es-search (Team:Search) |
Hello there! Anyone can help with the issue? It's highly important for our application. Thanks |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Hello. Anyone can help with the issue? It's highly important for our application. Thank you |
Hello there! Anyone can help with the issue? It's highly important for our application 🙏🏻 |
Remove the edge_ngram filter as it’s unnecessary and causing the "issue". The completion suggester already operates on prefixes, so indexing ngrams like c, co, cont, etc., isn't required. Since queries on the completion field are prefix-based, |
thank you! it solved the problem. I appreciate your support |
Elasticsearch Version
8.6.2, 8.8.2
Installed Plugins
jmorphy2 (https://github.com/anti-social/jmorphy2), LTR plugin (https://elasticsearch-learning-to-rank.readthedocs.io/en/latest/)
Java Version
openjdk version "19.0.2" 2023-01-17 // OpenJDK Runtime Environment (build 19.0.2+7-44) // OpenJDK 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing)
OS Version
Linux es-search-v2-es-data-1 5.4.0-167-generic #184-Ubuntu SMP Tue Oct 31 09:21:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Problem Description
I use fuzzing in my quries to completion suggester. It seems like
min_length
andfuzziness
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 bug is reproducible with ES 8.6.2 and 8.8.2.
Steps to Reproduce
Complete Python code to reproduce the bug. Copy and run.
The code is split into .ipynb cells.
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: