Github user cbismuth commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/496#discussion_r232943788
--- Diff:
lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java ---
@@ -68,6 +68,18 @@ public void setScorer(Scorable scorer) throws
IOException {
}
static boolean canEarlyTerminate(Sort searchSort, Sort indexSort) {
+ return canEarlyTerminateOnDocId(searchSort, indexSort) ||
+ canEarlyTerminateOnPrefix(searchSort, indexSort);
+ }
+
+ private static boolean canEarlyTerminateOnDocId(Sort searchSort, Sort
indexSort) {
--- End diff --
> since docs are visited in doc Id order, if compare is 0, it means
> this document is largest than anything else in the queue, and
> therefore not competitive.
I'm not at ease with this change because this comment states that docs are
visited in doc id order. Therefore did you mean we should completely remove the
`canEarlyTerminateOnPrefix` early termination? Thanks.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]