Class TopScoreDocCollectorManager
- All Implemented Interfaces:
CollectorManager<TopScoreDocCollector,TopDocs>
MaxScoreAccumulator to propagate the minimum score across segments
Note that a new collectorManager should be created for each search due to its internal states.
-
Constructor Summary
ConstructorsConstructorDescriptionTopScoreDocCollectorManager(int numHits, int totalHitsThreshold) Creates a newTopScoreDocCollectorManagergiven the number of hits to collect and the number of hits to count accurately, with thread-safe internal states.TopScoreDocCollectorManager(int numHits, ScoreDoc after, int totalHitsThreshold) Creates a newTopScoreDocCollectorManagergiven the number of hits to collect and the number of hits to count accurately, with thread-safe internal states.TopScoreDocCollectorManager(int numHits, ScoreDoc after, int totalHitsThreshold, boolean supportsConcurrency) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionReturn a newCollector.reduce(Collection<TopScoreDocCollector> collectors) Reduce the results of individual collectors into a meaningful result.
-
Constructor Details
-
TopScoreDocCollectorManager
@Deprecated public TopScoreDocCollectorManager(int numHits, ScoreDoc after, int totalHitsThreshold, boolean supportsConcurrency) Deprecated.UseTopScoreDocCollectorManager(int, ScoreDoc, int), the supportsConcurrency parameter is now a no-op.Creates a newTopScoreDocCollectorManagergiven the number of hits to collect and the number of hits to count accurately.NOTE: If the total hit count of the top docs is less than or exactly
totalHitsThresholdthen this value is accurate. On the other hand, if theTopDocs.totalHitsvalue is greater thantotalHitsThresholdthen its value is a lower bound of the hit count. A value ofInteger.MAX_VALUEwill make the hit count accurate but will also likely make query processing slower.NOTE: The instances returned by this method pre-allocate a full array of length
numHits, and fill the array with sentinel objects.- Parameters:
numHits- the number of results to collect.after- the previous doc after which matching docs will be collected.totalHitsThreshold- the number of docs to count accurately. If the query matches more thantotalHitsThresholdhits then its hit count will be a lower bound. On the other hand if the query matches less than or exactlytotalHitsThresholdhits then the hit count of the result will be accurate.Integer.MAX_VALUEmay be used to make the hit count accurate, but this will also make query processing slower.
-
TopScoreDocCollectorManager
Creates a newTopScoreDocCollectorManagergiven the number of hits to collect and the number of hits to count accurately, with thread-safe internal states.NOTE: If the total hit count of the top docs is less than or exactly
totalHitsThresholdthen this value is accurate. On the other hand, if theTopDocs.totalHitsvalue is greater thantotalHitsThresholdthen its value is a lower bound of the hit count. A value ofInteger.MAX_VALUEwill make the hit count accurate but will also likely make query processing slower.NOTE: The instances returned by this method pre-allocate a full array of length
numHits, and fill the array with sentinel objects.- Parameters:
numHits- the number of results to collect.after- the previous doc after which matching docs will be collected.totalHitsThreshold- the number of docs to count accurately. If the query matches more thantotalHitsThresholdhits then its hit count will be a lower bound. On the other hand if the query matches less than or exactlytotalHitsThresholdhits then the hit count of the result will be accurate.Integer.MAX_VALUEmay be used to make the hit count accurate, but this will also make query processing slower.
-
TopScoreDocCollectorManager
public TopScoreDocCollectorManager(int numHits, int totalHitsThreshold) Creates a newTopScoreDocCollectorManagergiven the number of hits to collect and the number of hits to count accurately, with thread-safe internal states.NOTE: If the total hit count of the top docs is less than or exactly
totalHitsThresholdthen this value is accurate. On the other hand, if theTopDocs.totalHitsvalue is greater thantotalHitsThresholdthen its value is a lower bound of the hit count. A value ofInteger.MAX_VALUEwill make the hit count accurate but will also likely make query processing slower.NOTE: The instances returned by this method pre-allocate a full array of length
numHits, and fill the array with sentinel objects.- Parameters:
numHits- the number of results to collect.totalHitsThreshold- the number of docs to count accurately. If the query matches more thantotalHitsThresholdhits then its hit count will be a lower bound. On the other hand if the query matches less than or exactlytotalHitsThresholdhits then the hit count of the result will be accurate.Integer.MAX_VALUEmay be used to make the hit count accurate, but this will also make query processing slower.
-
-
Method Details
-
newCollector
Description copied from interface:CollectorManagerReturn a newCollector. This must return a different instance on each call.- Specified by:
newCollectorin interfaceCollectorManager<TopScoreDocCollector,TopDocs>
-
reduce
Description copied from interface:CollectorManagerReduce the results of individual collectors into a meaningful result. For instance aTopDocsCollectorwould compute thetop docsof 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:
reducein interfaceCollectorManager<TopScoreDocCollector,TopDocs> - Throws:
IOException
-
TopScoreDocCollectorManager(int, ScoreDoc, int), the supportsConcurrency parameter is now a no-op.