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