Method Create
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 false, then the results' scores will be set to Float.NaN. Setting this to true affects performance, as it incurs the score computation on each competitive result. Therefore if document scores are not required by the application, it is recommended to set it to false. |
System.Boolean | trackMaxScore | specifies whether the query's maxScore should be tracked and set
on the resulting TopDocs. Note that if set to false,
MaxScore returns Float.NaN. Setting this to
true affects performance as it incurs the score computation on
each result. Also, setting this true automatically sets
|
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. |