zhaih commented on code in PR #12380:
URL: https://github.com/apache/lucene/pull/12380#discussion_r1244672724


##########
lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java:
##########
@@ -749,6 +749,9 @@ protected void search(List<LeafReaderContext> leaves, 
Weight weight, Collector c
           partialResult = true;
         }
       }
+      // Note: this is called if collection ran successfully, including the 
above special cases of

Review Comment:
   Can we add this comment to javadoc as well?



##########
lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java:
##########
@@ -706,6 +711,14 @@ private void doUnionScoring(Bits acceptDocs, LeafCollector 
collector, DocsAndCos
 
       nextChunkStart += CHUNK;
     }
+
+    collector.finish();

Review Comment:
   This can use the `finish(LeafCollector, Collection<DocsAndCost>)` method too?



##########
lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java:
##########
@@ -749,6 +749,9 @@ protected void search(List<LeafReaderContext> leaves, 
Weight weight, Collector c
           partialResult = true;
         }
       }
+      // Note: this is called if collection ran successfully, including the 
above special cases of
+      // CollectionTerminatedException and TimeExceededException, but no other 
exception.
+      leafCollector.finish();

Review Comment:
   I wonder whether it worths passing in the exceptions if any in case of early 
termination, but I can't think of a concrete example of how it might be useful 
right now (maybe user want a faster finish step in case of early terminated by 
time?), maybe we can add it later if there's a real need?



-- 
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

Reply via email to