Skip to content

Commit

Permalink
Invalid skipper now preserves scorerSupplier optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianWoolfolk committed Oct 28, 2024
1 parent 7934a3e commit 99af41d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,14 @@ private IteratorAndCount getDocIdSetIteratorOrNull(LeafReaderContext context) th
DocValuesSkipper skipper = context.reader().getDocValuesSkipper(field);
if (skipper != null) {
if (skipper.minValue() > upperValue || skipper.maxValue() < lowerValue) {
return null;
}
if (skipper.docCount() == context.reader().maxDoc()
&& skipper.minValue() >= lowerValue
&& skipper.maxValue() <= upperValue) {
return IteratorAndCount.all(skipper.docCount());
// Instead of returning null, act as there's no skipper.
skipper = null;
} else {
if (skipper.docCount() == context.reader().maxDoc()
&& skipper.minValue() >= lowerValue
&& skipper.maxValue() <= upperValue) {
return IteratorAndCount.all(skipper.docCount());
}
}
}

Expand Down

0 comments on commit 99af41d

Please sign in to comment.