diff --git a/lucene/core/src/java/org/apache/lucene/index/LegacySortedNumericDocValuesWrapper.java b/lucene/core/src/java/org/apache/lucene/index/LegacySortedNumericDocValuesWrapper.java index cfb61e3c2d1..a75274e999e 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LegacySortedNumericDocValuesWrapper.java +++ b/lucene/core/src/java/org/apache/lucene/index/LegacySortedNumericDocValuesWrapper.java @@ -77,6 +77,7 @@ public final class LegacySortedNumericDocValuesWrapper extends SortedNumericDocV public boolean advanceExact(int target) throws IOException { docID = target; values.setDocument(docID); + upto = 0; return values.count() != 0; }