Skip to content
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

Exactness does not match correctly in presence of hard separators #3823

Closed
dureuill opened this issue Jun 8, 2023 · 2 comments · Fixed by #3824
Closed

Exactness does not match correctly in presence of hard separators #3823

dureuill opened this issue Jun 8, 2023 · 2 comments · Fixed by #3824
Labels
bug Something isn't working as expected v1.3.0 PRs/issues solved in v1.3.0 released on 2023-07-31
Milestone

Comments

@dureuill
Copy link
Contributor

dureuill commented Jun 8, 2023

Describe the bug

When a query contains a hard separator like Batman: the dark knight returns, part 1, then documents with the title Batman: the dark knight returns, part 1 are not matched with the strategy MatchesFull, while they should.

This is due to multiple factors

  • hard separators are not given a correct position when parsing queries
  • the field_id_word_count_docids stores only the word count up to 10.
  • the field_id_word_count_docids stores the max position instead of the number of words. This max position takes into account the offset of hard separators and so we easily get higher than 10.

To Reproduce
Steps to reproduce the behavior:

  1. Use meilisearch from Add normalized and detailed scores to documents returned by a query #3821
  2. Index movies
  3. Query Batman: the dark knight returns, part 1 with ranking score details enabled
  4. Notice that the match is matchesStart or noExactMatch instead of fullMatch

Expected behavior
Exactness matches fullMatch in this case

Meilisearch version:
v1.1.1, v1.2

@curquiza
Copy link
Member

curquiza commented Jun 8, 2023

Hello @dureuill
Thanks for the report and the bug fix 🙏
Is this bug present in v1.2? My question behind: should we add it to the v1.3 changelogs as a bug fix?

Also, I recommend avoiding writing main as Meilisearch version -> when we read the issue in the future, main does not have the same meaning as now.
The best is a version, or at least a commit sha (and precise if we are between v1.2 and v1.3 sprint)

@curquiza curquiza added the bug Something isn't working as expected label Jun 8, 2023
@dureuill
Copy link
Contributor Author

dureuill commented Jun 8, 2023

Is this bug present in v1.2? My question behind: should we add it to the v1.3 changelogs as a bug fix?

Yes, and also in v1.1 and earlier in some shape

Also, I recommend avoiding writing main as Meilisearch version -> when we read the issue in the future, main does not have the same meaning as now.

Duly noted, thanks I'll edit

@meili-bors meili-bors bot closed this as completed in 047d22f Jun 8, 2023
@meili-bot meili-bot added the v1.3.0 PRs/issues solved in v1.3.0 released on 2023-07-31 label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected v1.3.0 PRs/issues solved in v1.3.0 released on 2023-07-31
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants