jpountz commented on code in PR #12405: URL: https://github.com/apache/lucene/pull/12405#discussion_r1269721890
########## lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java: ########## @@ -309,38 +322,109 @@ private void updateSkipInterval(boolean success) { } } - @Override - public DocIdSetIterator competitiveIterator() { - if (enableSkipping == false) return null; - return new DocIdSetIterator() { - private int docID = competitiveIterator.docID(); - - @Override - public int nextDoc() throws IOException { - return advance(docID + 1); + /** + * If {@link NumericComparator#pruning} equals {@link Pruning#GREATER_THAN_OR_EQUAL_TO}, we + * could better tune the {@link NumericLeafComparator#maxValueAsBytes}/{@link + * NumericLeafComparator#minValueAsBytes}. For instance, if the sort is ascending and bottom + * value is 5, we will use a range on [MIN_VALUE, 4]. + */ + private void encodeBottom() { + if (pruning == Pruning.GREATER_THAN_OR_EQUAL_TO && isBottomMinOrMax() == false) { Review Comment: Can we avoid introducing this `isBottomMinOrMax()` method, and instead: - only subtract `deltaOne` if `bottom` is not full of zeroes - only add `deltaOne` if `bottom` is not full of `0xff` -- 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