Class TopDocs
Represents hits returned by Search(Query, Filter, Int32) and Search(Query, Int32).
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class TopDocs : object
Constructors
| Improve this Doc View SourceTopDocs(Int32, ScoreDoc[], Single)
Declaration
public TopDocs(int totalHits, ScoreDoc[] scoreDocs, float maxScore)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | totalHits | |
ScoreDoc[] | scoreDocs | |
System.Single | maxScore |
Properties
| Improve this Doc View SourceMaxScore
Returns the maximum score value encountered. Note that in case
scores are not tracked, this returns
Declaration
public virtual float MaxScore { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ScoreDocs
The top hits for the query.
Declaration
public ScoreDoc[] ScoreDocs { get; set; }
Property Value
Type | Description |
---|---|
ScoreDoc[] |
TotalHits
The total number of hits for the query.
Declaration
public int TotalHits { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceMerge(Sort, Int32, TopDocs[])
Returns a new TopDocs, containing topN
results across
the provided TopDocs, sorting by the specified
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
Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean).
Pass sort
=null to merge sort by score descending.
Declaration
public static TopDocs Merge(Sort sort, int topN, TopDocs[] shardHits)
Parameters
Type | Name | Description |
---|---|---|
Sort | sort | |
System.Int32 | topN | |
TopDocs[] | shardHits |
Returns
Type | Description |
---|---|
TopDocs |
Merge(Sort, Int32, Int32, TopDocs[])
Same as Merge(Sort, Int32, TopDocs[]) but also slices the result at the same time based
on the provided start and size. The return TopDocs
will always have a scoreDocs with length of
at most Count.
Declaration
public static TopDocs Merge(Sort sort, int start, int size, TopDocs[] shardHits)
Parameters
Type | Name | Description |
---|---|---|
Sort | sort | |
System.Int32 | start | |
System.Int32 | size | |
TopDocs[] | shardHits |
Returns
Type | Description |
---|---|
TopDocs |