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

Incorrect deletion of documents when using the disableOnAttributes typo setting + reduce size of the index on DB #3816

Closed
loiclec opened this issue Jun 7, 2023 · 1 comment · Fixed by #3819
Assignees
Labels
bug Something isn't working as expected indexing v1.3.0 PRs/issues solved in v1.3.0 released on 2023-07-31
Milestone

Comments

@loiclec
Copy link
Contributor

loiclec commented Jun 7, 2023

To reproduce, on Meilisearch v1.2.0 (and earlier versions):

Set the searchable attributes to [text, exact]
Set the disableOnAttributes to: [exact]

Add the following documents:

    { id: 0, text: "hello" }
    { id: 1, exact: "hello" }

Delete the document with the external id 1 (make sure to disable soft deletion).

The remaining documents are correct:

    { id: 0, text: "hello" }

But the words_fst structure in the index was incorrectly updated. It does not contain hello anymore.
As a result, if we now search for hello, we get zero results.

@loiclec loiclec added bug Something isn't working as expected indexing labels Jun 7, 2023
@loiclec loiclec self-assigned this Jun 7, 2023
@loiclec loiclec changed the title Incorrect deletion of documents when using the disableOnAttributes Incorrect deletion of documents when using the disableOnAttributes typo setting Jun 7, 2023
meili-bors bot added a commit that referenced this issue Jun 7, 2023
3817: Fix deletion bug that sometimes occur when using `disableOnAttributes` typo setting r=Kerollmops a=loiclec

Fixes #3816

The idea of the fix is simple: we keep not only a list of words to delete, but also a list of words to **keep**, which takes precedence.
To get the final, correct list of words to delete from the FST, we look at those that should both be deleted and not kept.


Co-authored-by: Loïc Lecrenier <loic.lecrenier@icloud.com>
@meili-bors meili-bors bot closed this as completed in 9dcf1da Jun 7, 2023
@loiclec loiclec added this to the v1.3.0 milestone Jun 8, 2023
@curquiza
Copy link
Member

curquiza commented Jun 8, 2023

Also reduce size of the index #3819 (comment)

@curquiza curquiza changed the title Incorrect deletion of documents when using the disableOnAttributes typo setting Incorrect deletion of documents when using the disableOnAttributes typo setting + reduce size of the index on DB 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 indexing 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