[
https://issues.apache.org/jira/browse/LUCENE-10002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17482010#comment-17482010
]
ASF subversion and git services commented on LUCENE-10002:
----------------------------------------------------------
Commit 794f941f52f77737633ea23cd1892d330ce030a7 in lucene's branch
refs/heads/branch_9x from Luca Cavanna
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=794f941 ]
LUCENE-10002: Replace simple usages of TotalHitCountCollector with
IndexSearcher#count (#612)
In case only number of documents are collected, IndexSearcher#search(Query,
Collector) is commonly used, which does not use the executor that's been
eventually set to the searcher. Calling `IndexSearcher#count(Query)` makes the
code more concise and is also more correct as it honours the executor that's
been set to the searcher instance.
Co-authored-by: Adrien Grand <[email protected]>
> Remove IndexSearcher#search(Query,Collector) in favor of
> IndexSearcher#search(Query,CollectorManager)
> -----------------------------------------------------------------------------------------------------
>
> Key: LUCENE-10002
> URL: https://issues.apache.org/jira/browse/LUCENE-10002
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Priority: Minor
> Time Spent: 10h 20m
> Remaining Estimate: 0h
>
> It's a bit trappy that you can create an IndexSearcher with an executor, but
> that it would always search on the caller thread when calling
> {{IndexSearcher#search(Query,Collector)}}.
> Let's remove {{IndexSearcher#search(Query,Collector)}}, point our users to
> {{IndexSearcher#search(Query,CollectorManager)}} instead, and change factory
> methods of our main collectors (e.g. {{TopScoreDocCollector#create}}) to
> return a {{CollectorManager}} instead of a {{Collector}}?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]