Package org.apache.lucene.sandbox.search
Class LargeNumHitsTopDocsCollectorManager
java.lang.Object
org.apache.lucene.sandbox.search.LargeNumHitsTopDocsCollectorManager
- All Implemented Interfaces:
CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>
public class LargeNumHitsTopDocsCollectorManager
extends Object
implements CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>
CollectorManager for
LargeNumHitsTopDocsCollector that enables concurrent collection of
top docs across multiple segments.
Example usage:
IndexSearcher searcher = ...; // your IndexSearcher
TopDocs topDocs = searcher.search(new MatchAllDocsQuery(),
new LargeNumHitsTopDocsCollectorManager(100_000));
System.out.println("Total hits: " + topDocs.totalHits.value());
-
Constructor Summary
ConstructorsConstructorDescriptionLargeNumHitsTopDocsCollectorManager(int numHits) Creates a newLargeNumHitsTopDocsCollectorManagergiven the number of hits to collect. -
Method Summary
-
Constructor Details
-
LargeNumHitsTopDocsCollectorManager
public LargeNumHitsTopDocsCollectorManager(int numHits) Creates a newLargeNumHitsTopDocsCollectorManagergiven the number of hits to collect.- Parameters:
numHits- the number of results to collect.
-
-
Method Details
-
newCollector
- Specified by:
newCollectorin interfaceCollectorManager<LargeNumHitsTopDocsCollector,TopDocs>
-
reduce
- Specified by:
reducein interfaceCollectorManager<LargeNumHitsTopDocsCollector,TopDocs> - Throws:
IOException
-