Class TopFieldCollector
A ICollector that sorts by SortField using FieldComparers.
See the Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean) method for instantiating a TopFieldCollector.
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public abstract class TopFieldCollector : TopDocsCollector<FieldValueHitQueue.Entry>, ITopDocsCollector, ICollector
Properties
| Improve this Doc View SourceAcceptsDocsOutOfOrder
Declaration
public override bool AcceptsDocsOutOfOrder { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
| Improve this Doc View SourceCreate(Sort, Int32, FieldDoc, Boolean, Boolean, Boolean, Boolean)
Creates a new TopFieldCollector from the given arguments.
NOTE: The instances returned by this method
pre-allocate a full array of length
numHits
.
Declaration
public static TopFieldCollector Create(Sort sort, int numHits, FieldDoc after, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder)
Parameters
Type | Name | Description |
---|---|---|
Sort | sort | The sort criteria (SortFields). |
System.Int32 | numHits | The number of results to collect. |
FieldDoc | after | Only hits after this FieldDoc will be collected |
System.Boolean | fillFields | Specifies whether the actual field values should be returned on the results (FieldDoc). |
System.Boolean | trackDocScores | Specifies whether document scores should be tracked and set on the
results. Note that if set to |
System.Boolean | trackMaxScore | Specifies whether the query's maxScore should be tracked and set
on the resulting TopDocs. Note that if set to |
System.Boolean | docsScoredInOrder | Specifies whether documents are scored in doc Id order or not by the given Scorer in SetScorer(Scorer). |
Returns
Type | Description |
---|---|
TopFieldCollector | A TopFieldCollector instance which will sort the results by the sort criteria. |
Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean)
Creates a new TopFieldCollector from the given arguments.
NOTE: The instances returned by this method
pre-allocate a full array of length
numHits
.
Declaration
public static TopFieldCollector Create(Sort sort, int numHits, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder)
Parameters
Type | Name | Description |
---|---|---|
Sort | sort | The sort criteria (SortFields). |
System.Int32 | numHits | The number of results to collect. |
System.Boolean | fillFields | Specifies whether the actual field values should be returned on the results (FieldDoc). |
System.Boolean | trackDocScores | Specifies whether document scores should be tracked and set on the
results. Note that if set to |
System.Boolean | trackMaxScore | Specifies whether the query's Lucene.Net.Search.TopFieldCollector.maxScore should be tracked and set
on the resulting TopDocs. Note that if set to |
System.Boolean | docsScoredInOrder | Specifies whether documents are scored in doc Id order or not by the given Scorer in SetScorer(Scorer). |
Returns
Type | Description |
---|---|
TopFieldCollector | A TopFieldCollector instance which will sort the results by the sort criteria. |
NewTopDocs(ScoreDoc[], Int32)
Declaration
protected override TopDocs NewTopDocs(ScoreDoc[] results, int start)
Parameters
Type | Name | Description |
---|---|---|
ScoreDoc[] | results | |
System.Int32 | start |
Returns
Type | Description |
---|---|
TopDocs |
Overrides
PopulateResults(ScoreDoc[], Int32)
Declaration
protected override void PopulateResults(ScoreDoc[] results, int howMany)
Parameters
Type | Name | Description |
---|---|---|
ScoreDoc[] | results | |
System.Int32 | howMany |