Abstract base class for sorting hits returned by a Query.

This class should only be used if the other SortField types (SCORE, DOC, STRING, INT, FLOAT) do not provide an adequate sorting. It maintains an internal cache of values which could be quite large. The cache is an array of Comparable, one for each document in the index. There is a distinct Comparable for each unique term in the field - if some documents have the same term in the field, the cache array will have entries which reference the same Comparable. This class will be used as part of a key to a FieldCache value. You must implement hashCode and equals to avoid an explosion in RAM usage if you use instances that are not the same instance. If you are searching using the Remote contrib, the same instance of this class on the client will be a new instance on every call to the server, so hashCode/equals is very important in that situation.

Created: Apr 21, 2004 5:08:38 PM

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

Syntax

C#
[SerializableAttribute]
[ObsoleteAttribute("Please use FieldComparatorSource instead.")]
public abstract class SortComparator : SortComparatorSource
Visual Basic
<SerializableAttribute> _
<ObsoleteAttribute("Please use FieldComparatorSource instead.")> _
Public MustInherit Class SortComparator _
	Implements SortComparatorSource
Visual C++
[SerializableAttribute]
[ObsoleteAttribute(L"Please use FieldComparatorSource instead.")]
public ref class SortComparator abstract : SortComparatorSource

Inheritance Hierarchy

System..::..Object
  Lucene.Net.Search..::..SortComparator

See Also