jainankitk commented on code in PR #15397:
URL: https://github.com/apache/lucene/pull/15397#discussion_r2488322896
##########
lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java:
##########
@@ -364,6 +366,25 @@ int docCount() {
return pointValues.getDocCount();
}
+ /**
+ * If queue is full and global min/max point values are not competitive
with bottom then set an
+ * empty iterator as competitive iterator.
+ *
+ * @throws IOException i/o exception while fetching min and max values
from point values
+ */
+ void postInitializeCompetitiveIterator() throws IOException {
+ if (queueFull) {
+ long bottom = leafComparator.bottomAsComparableLong();
+ long minValue = sortableBytesToLong(pointValues.getMinPackedValue());
Review Comment:
This looks like a nice optimization. I am wondering if we still need to
check for missing point values?
```
// if some documents have missing points, check that missing values
prohibits optimization
if (docCount() < maxDoc && isMissingValueCompetitive()) {
return;
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]