ChrisHegarty commented on code in PR #14523: URL: https://github.com/apache/lucene/pull/14523#discussion_r2050728572
########## lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java: ########## @@ -524,6 +524,7 @@ public int advance(int target) throws IOException { @Override public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException { + upTo = Math.min(upTo, maxDoc); Review Comment: ++ ########## lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java: ########## @@ -434,6 +434,9 @@ public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOExcept if (competitiveIterator.docID() < doc) { competitiveIterator.advance(doc); } + if (doc >= upTo) { + return; + } Review Comment: ++ ########## lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java: ########## @@ -236,10 +236,13 @@ private void scoreWindowUsingBitSet( windowMatches.set(0, windowMax - windowBase); } else { DocIdSetIterator lead = iterators.get(0); + int intoBitSetBase = windowBase; if (lead.docID() < windowBase) { - lead.advance(windowBase); + intoBitSetBase = lead.advance(windowBase); + } + if (intoBitSetBase < windowMax) { + lead.intoBitSet(windowMax, windowMatches, intoBitSetBase); } - lead.intoBitSet(windowMax, windowMatches, windowBase); Review Comment: ++ -- 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-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org