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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
