- All Implemented Interfaces:
public abstract class TopScoreDocCollector extends TopDocsCollector<ScoreDoc>A
Collectorimplementation that collects the top-scoring hits, returning them as a
TopDocs. This is used by
TopDocs-based search. Hits are sorted by score descending and then (when the scores are tied) docID ascending. When you create an instance of this collector you should know in advance whether documents are going to be collected in doc Id order or not.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
create(int numHits, ScoreDoc after)
needsScores()Indicates if document scores are needed by this collector.
newTopDocs(ScoreDoc results, int start)Returns a
TopDocsinstance containing the given results.
Methods inherited from class org.apache.lucene.search.TopDocsCollector
getTotalHits, populateResults, topDocs, topDocs, topDocs, topDocsSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static TopScoreDocCollector create(int numHits)
public static TopScoreDocCollector create(int numHits, ScoreDoc after)Creates a new
TopScoreDocCollectorgiven the number of hits to collect, the bottom of the previous page, and whether documents are scored in order by the input
NOTE: The instances returned by this method pre-allocate a full array of length
numHits, and fill the array with sentinel objects.
newTopDocsDescription copied from class:
TopDocsinstance containing the given results. If
resultsis null it means there are no results to return, either because there were 0 calls to collect() or because the arguments to topDocs were invalid.
public boolean needsScores()Description copied from interface:
CollectorIndicates if document scores are needed by this collector.
trueif scores are needed.