You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "jpountz (via GitHub)" <gi...@apache.org> on 2023/09/28 19:26:39 UTC

[GitHub] [lucene] jpountz commented on a diff in pull request #12380: Add a post-collection hook to LeafCollector.

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


##########
lucene/suggest/src/java/org/apache/lucene/search/suggest/document/SuggestIndexSearcher.java:
##########
@@ -67,14 +68,16 @@ public void suggest(CompletionQuery query, TopSuggestDocsCollector collector) th
     for (LeafReaderContext context : getIndexReader().leaves()) {
       BulkScorer scorer = weight.bulkScorer(context);
       if (scorer != null) {
+        LeafCollector leafCollector = collector.getLeafCollector(context);
         try {

Review Comment:
   Trying to remember what was on my mind at the time of the change, I think I wanted to keep the logic simple, since unlike IndexSearcher which may run any Collector, here it may only be a `TopSuggestDocsCollector`, which never throws a `CollectionTerminatedException`. I'm ok with moving the `getLeafCollector` call under the `try` block though, if you open a PR I'll be happy to approve it.



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org