Fix behaviour of 'when filter empty' for empty and notEmpty filter types. #13633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Originally discovered while investigating #13583, because
empty
andnotEmpty
filters are passed like so to the search endpoint:The
allFiltersEmpty
variable inpackages/backend-core/src/db/lucene.ts
does not get set tofalse
when these are the only filters in the search, a check prevents it.To fix this, I'm making certain
allFiltersEmpty
is set tofalse
when these filters are present, and I have added new tests to ensure this behaviour does not regress.Addresses
Launchcontrol
Fix some confusing behaviour when you perform a search that only contains an
empty
ornotEmpty
filter, and you have set the "when filter empty" to "none". Previously, "when filter empty: none" could cause searches to return no rows when there were filters present. This is no longer the case.