Package org.apache.lucene.search
Class TopScoreDocCollector
- All Implemented Interfaces:
Collector
A
Collector
implementation that collects the top-scoring hits, returning them as a TopDocs
. This is used by IndexSearcher
to implement 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.
NOTE: The values Float.NaN
and Float.NEGATIVE_INFINITY
are not valid
scores. This collector will not properly collect hits with such scores.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Scorable leaf collector -
Field Summary
Fields inherited from class org.apache.lucene.search.TopDocsCollector
EMPTY_TOPDOCS, pq, totalHits, totalHitsRelation
-
Method Summary
Modifier and TypeMethodDescriptionprotected TopDocs
newTopDocs
(ScoreDoc[] results, int start) Returns aTopDocs
instance containing the given results.Indicates what features are required from the scorer.protected void
protected void
updateMinCompetitiveScore
(Scorable scorer) 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
Methods inherited from interface org.apache.lucene.search.Collector
getLeafCollector, setWeight
-
Method Details
-
newTopDocs
Description copied from class:TopDocsCollector
Returns aTopDocs
instance containing the given results. Ifresults
is 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.- Overrides:
newTopDocs
in classTopDocsCollector<ScoreDoc>
-
scoreMode
Description copied from interface:Collector
Indicates what features are required from the scorer. -
updateGlobalMinCompetitiveScore
- Throws:
IOException
-
updateMinCompetitiveScore
- Throws:
IOException
-