Returns the {@link FieldComparator} to use for sorting. NOTE: This API is experimental and might change in incompatible ways in the next release.

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

Syntax

C#
public virtual FieldComparator GetComparator(
	int numHits,
	int sortPos
)
Visual Basic
Public Overridable Function GetComparator ( _
	numHits As Integer, _
	sortPos As Integer _
) As FieldComparator
Visual C++
public:
virtual FieldComparator^ GetComparator(
	int numHits, 
	int sortPos
)

Parameters

numHits
Type: System..::..Int32
number of top hits the queue will store
sortPos
Type: System..::..Int32
position of this SortField within {@link Sort}. The comparator is primary if sortPos==0, secondary if sortPos==1, etc. Some comparators can optimize themselves when they are the primary sort.

Return Value

{@link FieldComparator} to use when sorting

See Also