-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Exists key in filter has a bug #4632
Comments
Hey @mhgolij 👋 I just tried your example (with this single document) on a 1.8.0 version of Meilisearch, and it works as expected on my side. Can you provide your dataset (that you sent by email) reproduce correctly? # Send your document with a categories.144 set to novel
curl -X POST 'http://localhost:7700//indexes/books/documents' \
--header 'Content-Type: application/json' \
--data-raw $'[{ "id": 22323, "categories": { "144": "novel", "2": "poetry"}}]'
# Specify that the categories (and subfields) are filterable
curl -X PATCH 'http://localhost:7700//indexes/books/settings' \
--header 'Content-Type: application/json' \
--data-raw $'{ "filterableAttributes": ["categories"] }'
# Check that it returns our document (it does 🎉)
curl -X POST 'http://localhost:7700//indexes/books/search' \
--header 'Content-Type: application/json' \
--data-raw $'{"filter": "categories.144 EXISTS" }'
# Update the document to remove the categories.144 field
curl -X POST 'http://localhost:7700//indexes/books/documents' \
--header 'Content-Type: application/json' \
--data-raw $'[{"id": 22323, "categories": {"2": "poetry"}}]'
# Execute the query again and see that the document is no longer there (🎉)
curl -X POST 'http://localhost:7700//indexes/books/search' \
--header 'Content-Type: application/json' \
--data-raw $'{"filter": "categories.144 EXISTS"}' |
Hey @Kerollmops This is very strange. I also tested the code and the result was correct. I even placed this data in a loop of 30,000 iterations, and the result was still correct. However, the result is still incorrect with the original data... |
Thank you @mhgolij, I think it is a bug, but now we need to find the right reproducer. Please provide the dataset or maybe a dump of your dataset. Also, what is your typical use case with Meilisearch? How do you send your documents, update them, etc.? |
I am closing this issue as we cannot reproduce the bug. Feel free to reopen with a complete reproducer if it happens again. |
Describe the bug
When I use the Exists keyword on an object, the data is returned correctly. However, when I change one of the returned data and make sure it is not part of the filter, it still appears in the results.
Example
For example, I have a data with the following format:
When I use the filter "categories.144 Exists," I expect the above data to be part of the results, which happens. But when I subsequently modify the data as follows:
And use the same filter, this data still appears as part of the result (although the data itself is displayed correctly).
The point is that this issue does not exist with keywords like IN, so if I change my document to following structure:
and change my filter to "categories_id IN [144]' this work correctly
Meilisearch version:
v1.8.0
Additional context
using meilisearch php
The text was updated successfully, but these errors were encountered: