jpountz commented on code in PR #13449: URL: https://github.com/apache/lucene/pull/13449#discussion_r1627225989
########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java: ########## @@ -1690,4 +1722,78 @@ long getLongValue(long index) throws IOException { return mul * values.get(index & mask) + delta; } } + + @Override + public DocValuesSkipper getSkipper(FieldInfo field) throws IOException { + final DocValuesSkipperEntry entry = skippers.get(field.name); + + final IndexInput input = data.slice("doc value skipper", entry.offset, entry.length); + return new DocValuesSkipper() { + int minDocID = -1; + int maxDocID = -1; + long minValue, maxValue; + int docCount; + + @Override + public void advance(int target) throws IOException { + if (target > entry.maxDocId) { + minDocID = DocIdSetIterator.NO_MORE_DOCS; + maxDocID = DocIdSetIterator.NO_MORE_DOCS; + } else { + do { + minDocID = input.readInt(); + maxDocID = input.readInt(); + minValue = input.readLong(); + maxValue = input.readLong(); + docCount = input.readInt(); + } while (target > maxDocID); Review Comment: FWIW `DocIdSetIterator#advance` has a similar contract and some implementations also have side-effects when called twice on the same doc (which is why javadocs mention it's illegal to advance on a doc that is less than or equal to the current doc). -- 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