-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
matching strategy "all" is not matching expected hits #4636
Comments
Hello 👋 In your provided query Prefix search is only applied on the last query term, even with the Looking for I can see why the behavior is surprising. Applying prefix search only to the last term is for performance reasons |
Hi @dureuill and thank you for your response. This is probably the intended behaviour, although I'm having a rough time figuring out what I can expect to match, especially due to this blog: "This matching strategy is called: all because all query terms must be present in the document for it to be returned." The examples above all query terms that seem to be present and proper prefixes. Is this really the intended behaviour? |
Let's break down what happens in all the cases you're mentioning. When trying to understand relevancy, it can help to enable The TL;DR is that there are multiple effects at work, prefix is one of them, but there's also typo tolerance (which will depend on the length of words and the number of missing letters) and ngrams (can't find docs about them right now but the intuition is that they will help you find documents when the space is at the wrong location, e.g. finding documents for "batman" when querying "bat man").
Yes. If you don't want typo tolerance, you can disable it. However it is generally useful to humans typing queries. |
Describe the bug
When using matching strategy 'all', I expect that documents where all search terms of the query match at least one searchable attribute are considered as hits.
However, it seems that for some reason documents that should get considered as valid hits are ignored and not returned in the result.
To Reproduce
Steps to reproduce the behavior:
Request POST /indexes/movies/search:
{ "q": "Taisto", "matchingStrategy": "all" }
Result
1 hit, movie "Ariel", as expected
Request POST /indexes/movies/search
{ "q": "Kasu Taisto", "matchingStrategy": "all" }
Result
no hits
Expected behavior
In the given example, the overview attribute of the movie contains both search terms and this should get returned as a hit.
Meilisearch version:
V1.8
additional context
The behaviour can also be reproduced via the matching strategy example
The text was updated successfully, but these errors were encountered: