ChrisHegarty commented on code in PR #13449: URL: https://github.com/apache/lucene/pull/13449#discussion_r1626526797
########## 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: I'm a little confused by this - it looks wrong to me. Since something as simple as: ``` skipper.advance(doc); skipper.advance(doc); ``` will have a side-effect, when it should not, right? -- 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