Skip to content

Commit 9a7bcc9

Browse files
authored
Dynamic pruning with DocValueSkipper (#14672)
1 parent a039d90 commit 9a7bcc9

File tree

4 files changed

+322
-169
lines changed

4 files changed

+322
-169
lines changed

lucene/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Improvements
100100
* GITHUB#14602: Refactor the expressions compiler to use official ClassData BSM with indexed lookup
101101
(Uwe Schindler)
102102

103+
* GITHUB#14672: Numeric sort queries can take advantage of DocValuesSkipper to dynamic prune. (Guo Feng)
104+
103105
* GITHUB#14443: Support adaptive refresh in Searcher Managers (Vigya Sharma)
104106

105107
* GITHUB#14737: Clean up redundant code and comments in query node classes. (Stefan Vodita)

lucene/core/src/java/org/apache/lucene/search/DocValuesRangeIterator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ abstract static class Approximation extends AbstractDocIdSetIterator {
6767

6868
// Track a decision for all doc IDs between the current doc ID and upTo inclusive.
6969
Match match = Match.MAYBE;
70-
int upTo = -1;
70+
int upTo;
7171

7272
Approximation(
7373
DocIdSetIterator innerApproximation,
@@ -78,6 +78,7 @@ abstract static class Approximation extends AbstractDocIdSetIterator {
7878
this.skipper = skipper;
7979
this.lowerValue = lowerValue;
8080
this.upperValue = upperValue;
81+
this.upTo = skipper.maxDocID(0);
8182
}
8283

8384
@Override

0 commit comments

Comments
 (0)