Package org.apache.lucene.misc.search
Class DiversifiedTopDocsCollectorManager<C extends DiversifiedTopDocsCollector>
java.lang.Object
org.apache.lucene.misc.search.DiversifiedTopDocsCollectorManager<C>
- All Implemented Interfaces:
CollectorManager<C,TopDocs>
public abstract class DiversifiedTopDocsCollectorManager<C extends DiversifiedTopDocsCollector>
extends Object
implements CollectorManager<C,TopDocs>
A
CollectorManager for DiversifiedTopDocsCollector. Subclasses implement CollectorManager.newCollector() to supply concrete collector instances; this class provides the reduce(Collection) that merges per-slice results while preserving the diversity constraint
across the whole result set.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDiversifiedTopDocsCollectorManager(int numHits, int maxHitsPerKey) -
Method Summary
Modifier and TypeMethodDescriptionreduce(Collection<C> collectors) Merges per-slice results into a singleTopDocswhile re-applying the diversity constraint globally.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.search.CollectorManager
newCollector
-
Constructor Details
-
DiversifiedTopDocsCollectorManager
protected DiversifiedTopDocsCollectorManager(int numHits, int maxHitsPerKey) - Parameters:
numHits- maximum number of results to returnmaxHitsPerKey- maximum number of results per key allowed in the final results
-
-
Method Details
-
reduce
Merges per-slice results into a singleTopDocswhile re-applying the diversity constraint globally. Each per-slice collector may contain up tonumHitsresults, but the same key can appear in multiple slices;reduceenforcesmaxHitsPerKeyacross all slices.- Specified by:
reducein interfaceCollectorManager<C extends DiversifiedTopDocsCollector,TopDocs> - Throws:
IOException
-