|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.TopDocs
public class TopDocs
Represents hits returned by Searcher.search(Query,Filter,int)
and Searcher.search(Query,int)
.
Field Summary | |
---|---|
ScoreDoc[] |
scoreDocs
The top hits for the query. |
int |
totalHits
The total number of hits for the query. |
Constructor Summary | |
---|---|
TopDocs(int totalHits,
ScoreDoc[] scoreDocs,
float maxScore)
|
Method Summary | |
---|---|
float |
getMaxScore()
Returns the maximum score value encountered. |
static TopDocs |
merge(Sort sort,
int topN,
TopDocs[] shardHits)
Returns a new TopDocs, containing topN results across the provided TopDocs, sorting by the specified Sort . |
void |
setMaxScore(float maxScore)
Sets the maximum score value encountered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int totalHits
public ScoreDoc[] scoreDocs
Constructor Detail |
---|
public TopDocs(int totalHits, ScoreDoc[] scoreDocs, float maxScore)
Method Detail |
---|
public float getMaxScore()
Float.NaN
.
public void setMaxScore(float maxScore)
public static TopDocs merge(Sort sort, int topN, TopDocs[] shardHits) throws IOException
Sort
. Each of the TopDocs must have been sorted by
the same Sort, and sort field values must have been
filled (ie, fillFields=true
must be
passed to TopFieldCollector.create(org.apache.lucene.search.Sort, int, boolean, boolean, boolean, boolean)
.
Pass sort=null to merge sort by score descending.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |