Class SortField
Stores information about how to sort documents by terms in an individual field. Fields must be indexed in order to sort by them.
Created: Feb 11, 2004 1:25:29 PM
Inheritance
Namespace:
Assembly: Lucene.Net.NetCore.dll
Syntax
public class SortField : object
Constructors
Name | Description |
---|---|
SortField(String, FieldComparatorSource) | Creates a sort with a custom comparison function. |
SortField(String, FieldComparatorSource, Boolean) | Creates a sort, possibly in reverse, with a custom comparison function. |
SortField(String, Parser) | Creates a sort by terms in the given field, parsed to numeric values using a custom Parser. |
SortField(String, Parser, Boolean) | Creates a sort, possibly in reverse, by terms in the given field, parsed to numeric values using a custom Parser. |
SortField(String, Globalization.CultureInfo) | Creates a sort by terms in the given field sorted according to the given locale. |
SortField(String, Globalization.CultureInfo, Boolean) | Creates a sort, possibly in reverse, by terms in the given field sorted according to the given locale. |
SortField(String, Int32) | Creates a sort by terms in the given field with the type of term values explicitly given. |
SortField(String, Int32, Boolean) | Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given. |
Fields
Name | Description |
---|---|
BYTE | Sort using term values as encoded Bytes. Sort values are Byte and lower values are at the front. |
CUSTOM | Sort using a custom Comparator. Sort values are any Comparable and sorting is done according to natural order. |
DOC | Sort by document number (index order). Sort values are Integer and lower values are at the front. |
DOUBLE | Sort using term values as encoded Doubles. Sort values are Double and lower values are at the front. |
FIELD_DOC | Represents sorting by document number (index order). |
FIELD_SCORE | Represents sorting by document score (relevancy). |
FLOAT | Sort using term values as encoded Floats. Sort values are Float and lower values are at the front. |
INT | Sort using term values as encoded Integers. Sort values are Integer and lower values are at the front. |
LONG | Sort using term values as encoded Longs. Sort values are Long and lower values are at the front. |
SCORE | Sort by document score (relevancy). Sort values are Float and higher values are at the front. |
SHORT | Sort using term values as encoded Shorts. Sort values are Short and lower values are at the front. |
STRING | Sort using term values as Strings. Sort values are String and lower values are at the front. |
STRING_VAL | Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons. This is typically slower than STRING, which uses ordinals to do the sorting. |
Properties
Name | Description |
---|---|
ComparatorSource | Returns the FieldComparatorSource used for custom sorting |
Field | Returns the name of the field. Could return |
Locale | Returns the Locale by which term values are interpreted.
May return |
Parser | Returns the instance of a FieldCache parser that fits to the given sort type.
May return |
Reverse | Returns whether the sort should be reversed. |
Type | Returns the type of contents in the field. |
Methods
Name | Description |
---|---|
Equals(Object) | Returns true if |
GetComparator(Int32, Int32) | Returns the FieldComparator to use for sorting. NOTE: This API is experimental and might change in incompatible ways in the next release. |
GetHashCode() | Returns true if |
ToString() |