The SortField type exposes the following members.

Constructors

  NameDescription
Public methodSortField(String) Obsolete.
Creates a sort by terms in the given field where the type of term value is determined dynamically ({@link #AUTO AUTO}).
Public methodSortField(String, FieldComparatorSource)
Creates a sort with a custom comparison function.
Public methodSortField(String, Parser)
Creates a sort by terms in the given field, parsed to numeric values using a custom {@link FieldCache.Parser}.
Public methodSortField(String, SortComparatorSource) Obsolete.
Creates a sort with a custom comparison function.
Public methodSortField(String, Boolean) Obsolete.
Creates a sort, possibly in reverse, by terms in the given field where the type of term value is determined dynamically ({@link #AUTO AUTO}).
Public methodSortField(String, CultureInfo)
Creates a sort by terms in the given field sorted according to the given locale.
Public methodSortField(String, Int32)
Creates a sort by terms in the given field with the type of term values explicitly given.
Public methodSortField(String, FieldComparatorSource, Boolean)
Creates a sort, possibly in reverse, with a custom comparison function.
Public methodSortField(String, Parser, Boolean)
Creates a sort, possibly in reverse, by terms in the given field, parsed to numeric values using a custom {@link FieldCache.Parser}.
Public methodSortField(String, SortComparatorSource, Boolean) Obsolete.
Creates a sort, possibly in reverse, with a custom comparison function.
Public methodSortField(String, CultureInfo, Boolean)
Creates a sort, possibly in reverse, by terms in the given field sorted according to the given locale.
Public methodSortField(String, Int32, Boolean)
Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given.

Methods

  NameDescription
Public methodEquals
Returns true if
CopyC#
o
is equal to this. If a {@link SortComparatorSource} (deprecated) or {@link FieldCache.Parser} was provided, it must properly implement equals (unless a singleton is always used).
(Overrides Object..::..Equals(Object).)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetComparator
Returns the {@link FieldComparator} to use for sorting. NOTE: This API is experimental and might change in incompatible ways in the next release.
Public methodGetComparatorSource
Public methodGetFactory Obsolete.
Public methodGetField
Returns the name of the field. Could return
CopyC#
null
if the sort is by SCORE or DOC.
Public methodGetHashCode
Returns true if
CopyC#
o
is equal to this. If a {@link SortComparatorSource} (deprecated) or {@link FieldCache.Parser} was provided, it must properly implement hashCode (unless a singleton is always used).
(Overrides Object..::..GetHashCode()()()().)
Public methodGetLocale
Returns the Locale by which term values are interpreted. May return
CopyC#
null
if no Locale was specified.
Public methodGetParser
Returns the instance of a {@link FieldCache} parser that fits to the given sort type. May return
CopyC#
null
if no parser was specified. Sorting is using the default parser then.
Public methodGetReverse
Returns whether the sort should be reversed.
Public methodGetType
Returns the type of contents in the field.
Public methodGetUseLegacySearch Obsolete.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetUseLegacySearch Obsolete.
Use legacy IndexSearch implementation: search with a DirectoryReader rather than passing a single hit collector to multiple SegmentReaders.
Public methodToString (Overrides Object..::..ToString()()()().)

Fields

  NameDescription
Public fieldStatic memberAUTO Obsolete.
Guess type of sort based on field contents. A regular expression is used to look at the first term indexed for the field and determine if it represents an integer number, a floating point number, or just arbitrary string characters.
Public fieldStatic memberBYTE
Sort using term values as encoded Bytes. Sort values are Byte and lower values are at the front.
Public fieldStatic memberCUSTOM
Sort using a custom Comparator. Sort values are any Comparable and sorting is done according to natural order.
Public fieldStatic memberDOC
Sort by document number (index order). Sort values are Integer and lower values are at the front.
Public fieldStatic memberDOUBLE
Sort using term values as encoded Doubles. Sort values are Double and lower values are at the front.
Public fieldStatic memberFIELD_DOC
Represents sorting by document number (index order).
Public fieldStatic memberFIELD_SCORE
Represents sorting by document score (relevancy).
Public fieldStatic memberFLOAT
Sort using term values as encoded Floats. Sort values are Float and lower values are at the front.
Public fieldStatic memberINT
Sort using term values as encoded Integers. Sort values are Integer and lower values are at the front.
Public fieldStatic memberLONG
Sort using term values as encoded Longs. Sort values are Long and lower values are at the front.
Public fieldStatic memberSCORE
Sort by document score (relevancy). Sort values are Float and higher values are at the front.
Public fieldStatic memberSHORT
Sort using term values as encoded Shorts. Sort values are Short and lower values are at the front.
Public fieldStatic memberSTRING
Sort using term values as Strings. Sort values are String and lower values are at the front.
Public fieldStatic memberSTRING_VAL
Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons. This is typically slower than {@link #STRING}, which uses ordinals to do the sorting.

See Also