LuXugang commented on code in PR #12405: URL: https://github.com/apache/lucene/pull/12405#discussion_r1270201963
########## 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: > only subtract deltaOne if bottom is not full of zeroes only add deltaOne if bottom is not full of 0xff It seems only work for `int` and `long`: ```java float maxFloat = Float.MAX_VALUE; float minFloat = Float.MIN_VALUE; byte[] maxFloatByte = new byte[Float.BYTES]; byte[] minFloatByte = new byte[Float.BYTES]; FloatPoint.encodeDimension(maxFloat, maxFloatByte, 0); FloatPoint.encodeDimension(minFloat, minFloatByte, 0); ``` result was maxFloatByte: [-1, 127, -1, -1] and minFloat: [-128, 0, 0, 1] -- 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