Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Phrase search containing duplicates #647

Closed
ManyTheFish opened this issue Sep 19, 2022 · 0 comments · Fixed by #658
Closed

Phrase search containing duplicates #647

ManyTheFish opened this issue Sep 19, 2022 · 0 comments · Fixed by #658
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ManyTheFish
Copy link
Member

ManyTheFish commented Sep 19, 2022

When doing a PHRASE search containing several times the same word, no results are returned by Meilisearch.

Step to reproduce

  1. push some documents containing several times the same word together:
$ curl \
  -X POST 'http://localhost:7700/indexes/movies/documents' \
  -H 'Content-Type: application/json' \
  --data-binary '[{"id": 1, "title": "knock knock"}]'
  1. Make a PHRASE search query containing duplicates:
$ curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "\"knock knock\"" }'
  1. Meilisearch should return the document

Possible Fix

This Bug comes from the indexing part of the code when we compute the word_pair_proximity_docids database in src/update/index_documents/extract/extract_word_pair_proximity_docids.rs.
In document_word_positions_into_sorter we forgot to extract the proximity of the current position of the current word with the next position of it.

During the increase of the current word position we could extract the proximity between the current position and the next one.

Files expected to be modified

@ManyTheFish ManyTheFish added bug Something isn't working hacktoberfest good first issue Good for newcomers labels Sep 19, 2022
@curquiza curquiza transferred this issue from meilisearch/engine-team Sep 29, 2022
@bors bors bot closed this as completed in 55d8895 Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant