mayya-sharipova commented on a change in pull request #1351: LUCENE-9280: Collectors to skip noncompetitive documents URL: https://github.com/apache/lucene-solr/pull/1351#discussion_r394659789
########## File path: lucene/core/src/java/org/apache/lucene/search/FieldComparator.java ########## @@ -928,4 +928,9 @@ public int compareTop(int doc) throws IOException { @Override public void setScorer(Scorable scorer) {} } + + public static abstract class IteratorSupplierComparator<T> extends FieldComparator<T> implements LeafFieldComparator { + abstract DocIdSetIterator iterator(); + abstract void updateIterator() throws IOException; Review comment: Indeed it is more straightforward to just update an iterator in `setBottom` function of a comparator. But I was thinking it is better to have a special function for two reasons: 1) After updating an iterator, in `TopFieldCollector` we need to change `totalHitsRelation = TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO;` 2) we also need to check `hitsThresholdChecker.isThresholdReached()`, and passing not strictly related object `hitsThresholdChecker` to a comparator's constructor doesn't look nice to me. Please let me know if you think otherwise ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org