public class TotalHitCountCollectorManager extends Object implements CollectorManager<TotalHitCountCollector,Integer>Collector manager based on
TotalHitCountCollectorthat allows users to parallelize counting the number of hits, expected to be used mostly wrapped in
MultiCollectorManager. For cases when this is the only collector manager used,
IndexSearcher.count(Query)should be called instead of
IndexSearcher.search(Query, CollectorManager)as the former is faster whenever the count can be returned directly from the index statistics.
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
newCollector()Return a new
reduce(Collection<TotalHitCountCollector> collectors)Reduce the results of individual collectors into a meaningful result.
public TotalHitCountCollector newCollector() throws IOExceptionDescription copied from interface:
CollectorManagerReturn a new
Collector. This must return a different instance on each call.
public Integer reduce(Collection<TotalHitCountCollector> collectors) throws IOExceptionDescription copied from interface:
CollectorManagerReduce the results of individual collectors into a meaningful result. For instance a
TopDocsCollectorwould compute the
top docsof each collector and then merge them using
TopDocs.merge(int, TopDocs). This method must be called after collection is finished on all provided collectors.