You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ercsonusharma (via GitHub)" <gi...@apache.org> on 2026/10/08 10:44:47 UTC
[PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
ercsonusharma opened a new pull request, #5060:
URL: https://github.com/apache/solr/pull/5060
# Description
https://issues.apache.org/jira/browse/SOLR-18522
Faceting on `CombinedQuerySearchHandler` results can fail due to bug in union of the sub-query DocSets. When every sub-query matches only a few docs, they are `SortedIntDocSet`s, and `SortedIntDocSet.union()` returns a `BitDocSet` whose `FixedBitSet` is sized to the largest matching doc + 1, not `maxDoc`. `BitDocSet.iterator(LeafReaderContext)` assumes the bitset covers every segment and calls `bits.nextSetBit(docBase)` for later segments, which reads past the end of the array.
# Solution
`BitDocSet.iterator(LeafReaderContext)` now handles a bitset shorter than `maxDoc`
# Tests
- a unit test that takes the `union` of two `SortedIntDocSet`s over a two-segment reader and checks that per-segment iteration
- added a test in CombinedQueryComponentTest which indexes two 500-doc segments, runs two selective lexical sub-queries, and facets on a string docValues field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "nick-boss-tech (via GitHub)" <gi...@apache.org>.
nick-boss-tech commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6260845993
Hi @dsmiley, I took a look at this.
branch_9x backport of SOLR-18522 (PR #5060): two changes are needed for CombinedQueryComponentTest to compile and pass on branch_9x.
1. Compile: the JSON text block is a Java 15 feature and branch_9x builds with --release 11. Rewriting the literal as string concatenation fixes the compile.
2. testFacetWithSmallMatchesAcrossSegments: branch_9x's BaseDistributedSearchTestCase has no query(String handler, SolrParams) overload, unlike branch_10x. The call query("/search", params(...)) therefore resolves to query(Object...), which turns "/search" into a parameter with no query and no JSON body. Both sides return 0 documents, and the distributed side then reports maxScore 0.0 against a null control, so the test fails. Passing the handler as a parameter, params(CommonParams.QT, "/search", ...), fixes it.
Verified locally on branch_9x with JDK 11, release 11, seed 18522C0FFEE18522: CombinedQueryComponentTest 7/7 pass with both changes.
My branch for this:
https://github.com/nick-boss-tech/solr/tree/solr-18522-9x-backport-fix
AI investigated this and wrote the comment and I reviewed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6262360189
Thanks for helping Nick but our efforts overlapped with mine. If I pushed off falling asleep for just another 15 minutes last night, I would have pushed the fix I already worked on (all with AI). So this morning (now) I simply pushed it.
FWIW I *did* configure the "Lint" (precommit) job to notify who broke it, and it said it sent an email to Andrzej.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "sigram (via GitHub)" <gi...@apache.org>.
sigram merged PR #5060:
URL: https://github.com/apache/solr/pull/5060
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "sigram (via GitHub)" <gi...@apache.org>.
sigram commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6064399118
Thanks @ercsonusharma for working on this and providing a clean PR :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "iamsanjay (via GitHub)" <gi...@apache.org>.
iamsanjay commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6252964040
Build been failing for 9x because of Java text blocks.
https://develocity.apache.org/s/2mml2woq76xl4
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "ercsonusharma (via GitHub)" <gi...@apache.org>.
ercsonusharma commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6262604869
just had a look. Thanks, @dsmiley for the quick fix. wasn’t aware of this, and appreciate you taking care of these while backporting the previous changes to 9.x.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18522: Fix for SortedIntDocSet union affecting facet in Combined Query [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #5060:
URL: https://github.com/apache/solr/pull/5060#issuecomment-6256684366
FYI the 9x backport was done manually (by @sigram ). Backports are best done by automated processes. My automation, which always does precommit at a bare minimum. Just leave backports to me, folks :-) I'll fix this one.
Also... maybe the Jenkins job that does precommit should email directly who broke the build. _That_ job shouldn't be for a flaky reason. I'll work on that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org