fix(search): group multi-group fulltext filters before query clause - #1806
fix(search): group multi-group fulltext filters before query clause#1806SolanCheung wants to merge 9 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: formsg@163.com |
linhongyu510
left a comment
There was a problem hiding this comment.
The production change has the intended Lucene precedence, and I independently ran the new regression together with tests/utils/search/test_search_security.py: 18 passed. Multi-group, single-group, no-group, and invalid-group-id behavior are all covered.
One scope issue should be removed before merge: .github/workflows/validate-1249.yml is a one-off workflow that only triggers on pushes to validate/1249-group-filter-precedence. It does not validate this fork PR through the upstream pull_request gate, and after merge the upstream repository is not expected to have that branch, so the file becomes dead CI configuration. It also contradicts the PR scope statement that the diff is one production line plus the focused test file. Please drop that workflow from the PR and let the existing repository unit workflow run the tests once the fork approval gate is cleared. The core search fix itself looks correct on this head.
|
Addressed the review feedback: removed the one-off |
b375831 to
ed9483a
Compare
linhongyu510
left a comment
There was a problem hiding this comment.
Incremental review of the changes since my prior review at b40b2c6: the one-off workflow was removed as requested, the only test change is Ruff formatting, and the upstream merge introduces no change to the production fix. I reran tests/utils/search/test_fulltext_query_group_precedence.py together with tests/utils/search/test_search_security.py: 18 passed. Ruff check and format-check pass for both changed Python files, and git diff --check b40b2c6..ed9483a is clean. No new blocking issue found in the incremental diff. The remaining Tests, Pyright, and CodeQL entries are absent/action-required for this fork head rather than reported failures.
Summary
Fix #1249 by preserving the intended Lucene precedence when one or more
group_idfilters are combined with a full-text query.Current
mainemits a query shaped like:Because
ANDbinds more tightly thanOR, the text clause only constrains the final group. This PR groups the fullgroup_iddisjunction first:Scope
fulltext_query()builder.group_idfilters.Verification
tests/utils/search/test_search_security.py: 18 passed.main.Tests,Pyright Type Check, andCodeQL Advancedremainaction_requiredfor this forked PR, awaiting repository approval to run; this is an approval gate, not a test failure.Ready for maintainer review.