Creates a new {@link TopFieldCollector} from the given arguments.

NOTE: The instances returned by this method pre-allocate a full array of length

CopyC#
numHits
.

Namespace: Lucene.Net.Search
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public static TopFieldCollector create(
	Sort sort,
	int numHits,
	bool fillFields,
	bool trackDocScores,
	bool trackMaxScore,
	bool docsScoredInOrder
)
Visual Basic
Public Shared Function create ( _
	sort As Sort, _
	numHits As Integer, _
	fillFields As Boolean, _
	trackDocScores As Boolean, _
	trackMaxScore As Boolean, _
	docsScoredInOrder As Boolean _
) As TopFieldCollector
Visual C++
public:
static TopFieldCollector^ create(
	Sort^ sort, 
	int numHits, 
	bool fillFields, 
	bool trackDocScores, 
	bool trackMaxScore, 
	bool docsScoredInOrder
)

Parameters

sort
Type: Lucene.Net.Search..::..Sort
the sort criteria (SortFields).
numHits
Type: System..::..Int32
the number of results to collect.
fillFields
Type: System..::..Boolean
specifies whether the actual field values should be returned on the results (FieldDoc).
trackDocScores
Type: System..::..Boolean
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.
trackMaxScore
Type: System..::..Boolean
specifies whether the query's maxScore should be tracked and set on the resulting {@link TopDocs}. Note that if set to false, {@link TopDocs#GetMaxScore()} returns Float.NaN. Setting this to true affects performance as it incurs the score computation on each result. Also, setting this true automatically sets
CopyC#
trackDocScores
to true as well.
docsScoredInOrder
Type: System..::..Boolean
specifies whether documents are scored in doc Id order or not by the given {@link Scorer} in {@link #SetScorer(Scorer)}.

Return Value

a {@link TopFieldCollector} instance which will sort the results by the sort criteria.

See Also