cpoerschke commented on code in PR #12380:
URL: https://github.com/apache/lucene/pull/12380#discussion_r1340380526
##########
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:
Comparing this to the
https://github.com/apache/lucene/blob/6d764c3397d00f93bd4273bd8d1c9e51d6e104e6/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java#L710-L740
code I wonder if the `getLeafCollector` call should move inside the `try`
block here too?
```
final LeafCollector leafCollector;
try {
leafCollector = collector.getLeafCollector(context);
...
} catch (CollectionTerminatedException e) {
...
}
if (leafCollector != null) leafCollector.finish();
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]