- java.lang.Object
-
- org.apache.lucene.search.MultiCollectorManager
-
- All Implemented Interfaces:
CollectorManager<Collector,java.lang.Object[]>
public class MultiCollectorManager extends java.lang.Object implements CollectorManager<Collector,java.lang.Object[]>
ACollectorManager
implements which wrap a set ofCollectorManager
asMultiCollector
acts forCollector
.
-
-
Field Summary
Fields Modifier and Type Field Description private CollectorManager<Collector,?>[]
collectorManagers
-
Constructor Summary
Constructors Constructor Description MultiCollectorManager(CollectorManager<? extends Collector,?>... collectorManagers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collector
newCollector()
Return a newCollector
.java.lang.Object[]
reduce(java.util.Collection<Collector> reducableCollectors)
Reduce the results of individual collectors into a meaningful result.
-
-
-
Field Detail
-
collectorManagers
private final CollectorManager<Collector,?>[] collectorManagers
-
-
Constructor Detail
-
MultiCollectorManager
@SafeVarargs public MultiCollectorManager(CollectorManager<? extends Collector,?>... collectorManagers)
-
-
Method Detail
-
newCollector
public Collector newCollector() throws java.io.IOException
Description copied from interface:CollectorManager
Return a newCollector
. This must return a different instance on each call.- Specified by:
newCollector
in interfaceCollectorManager<Collector,java.lang.Object[]>
- Throws:
java.io.IOException
-
reduce
public java.lang.Object[] reduce(java.util.Collection<Collector> reducableCollectors) throws java.io.IOException
Description copied from interface:CollectorManager
Reduce the results of individual collectors into a meaningful result. For instance aTopDocsCollector
would compute thetop docs
of each collector and then merge them usingTopDocs.merge(int, TopDocs[])
. This method must be called after collection is finished on all provided collectors.- Specified by:
reduce
in interfaceCollectorManager<Collector,java.lang.Object[]>
- Throws:
java.io.IOException
-
-