meilisearch / milli

Search engine library for Meilisearch ⚡️
MIT License
464 stars 82 forks source link

Fix typo initial candidates computation #737

Closed ManyTheFish closed 1 year ago

ManyTheFish commented 1 year ago

When Typo criterion was after a different criterion than Words and the previous criterion wasn't returning any candidates at the first iteration of the bucket sort, then the initial_candidates were lost.

Now, Typoensure to keep the initial_candidates between iterations.

related to https://github.com/meilisearch/meilisearch/issues/3200#issuecomment-1345179578 related to https://github.com/meilisearch/meilisearch/issues/3228

ManyTheFish commented 1 year ago

@irevoire, Words and Typo criteria contain an Option<InitialCandidates> instead of InitialCandidates, so I had to make a different match. This comes from the fact that these two criteria are "lazier" than the others because they may not compute any candidates at their step letting the following criterion do it for them.

ManyTheFish commented 1 year ago

Poke @curquiza about this fix.

bors[bot] commented 1 year ago

Build succeeded:

curquiza commented 1 year ago

Is it normal we haven't added any tests here? At least both of the cases reported by the users