-
Notifications
You must be signed in to change notification settings - Fork 81
Prefer returning None
instead of using an FilterCondition::Empty
state
#422
Conversation
30a4a52
to
1c6c89f
Compare
I answered on the related issue with what I think raises my point. meilisearch/meilisearch#1338 (comment) |
@meilisearch/product-team can you confirm this is the behavior you expect? |
This is an issue that seems to have been raised when we switch from pest to nom, we used the The |
Thank you for the review! |
This is consistent with the behavior of other fields like |
This PR is related to the issue comment meilisearch/meilisearch#1338 (comment) which exhibits the fact that when a filter is known to be empty no results are returned which is wrong, the filter should not apply as no restriction is done on the documents set.
The filter system on the milli side has introduced an Empty state which was used in this kind of situation but I found out that it is not needed and that when we parse a filter and that it is empty we can simply return
None
as theFilter::from_array
constructor does. So I removed it and added tests!On the MeiliSearch side, we just need to match on a
None
and completely ignore the filter in such a case.