fix(query): preserve query OR conditions when appending AND filters - #213
fix(query): preserve query OR conditions when appending AND filters#213chai-masalla wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0459014924
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
Fixes incorrect Lucene query behavior caused by
ANDhaving higher precedence thanOR.When filters were appended to an existing query, the original query was not wrapped in parentheses. As a result:
when we had Lucene query
A OR Band filterCit was interpreted as:instead of:
This could allow results that match the first OR condition to bypass appended filters.
Fix
Wrap the existing query in parentheses before appending a filter:
This preserves the original query grouping and ensures appended filters apply to the complete query.