C# Класс Lucene.Net.Search.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 @since lucene 1.4

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
FIELD_DOC SortField
FIELD_SCORE SortField
STRING_FIRST object
STRING_LAST object
missingValue object

Открытые методы

Метод Описание
Equals ( object o ) : bool

Returns true if o is equal to this. If a FieldComparatorSource or {@link FieldCache.Parser} was provided, it must properly implement equals (unless a singleton is always used).

GetComparator ( int numHits, int sortPos ) : FieldComparator

Returns the FieldComparator to use for sorting. @lucene.experimental

GetHashCode ( ) : int

Returns true if o is equal to this. If a FieldComparatorSource or {@link FieldCache.Parser} was provided, it must properly implement hashCode (unless a singleton is always used).

NeedsScores ( ) : bool

Whether the relevance score is needed to sort documents.

Rewrite ( IndexSearcher searcher ) : SortField

Rewrites this SortField, returning a new SortField if a change is made. Subclasses should override this define their rewriting behavior when this SortField is of type SortField.Type#REWRITEABLE

SortField ( string field, Lucene.Net.Search.FieldCache parser ) : System

Creates a sort by terms in the given field, parsed to numeric values using a custom IFieldCache.Parser.

SortField ( string field, FieldCache parser, bool reverse ) : System

Creates a sort, possibly in reverse, by terms in the given field, parsed to numeric values using a custom IFieldCache.Parser.

SortField ( string field, FieldComparatorSource comparator ) : System

Creates a sort with a custom comparison function.

SortField ( string field, FieldComparatorSource comparator, bool reverse ) : System

Creates a sort, possibly in reverse, with a custom comparison function.

SortField ( string field, Type_e type ) : System

Creates a sort by terms in the given field with the type of term values explicitly given.

SortField ( string field, Type_e type, bool reverse ) : System

Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given.

ToString ( ) : string

Приватные методы

Метод Описание
InitFieldType ( string field, Type_e type ) : void

Описание методов

Equals() публичный метод

Returns true if o is equal to this. If a FieldComparatorSource or {@link FieldCache.Parser} was provided, it must properly implement equals (unless a singleton is always used).
public Equals ( object o ) : bool
o object
Результат bool

GetComparator() публичный метод

Returns the FieldComparator to use for sorting. @lucene.experimental
public GetComparator ( int numHits, int sortPos ) : FieldComparator
numHits int number of top hits the queue will store
sortPos int 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.
Результат FieldComparator

GetHashCode() публичный метод

Returns true if o is equal to this. If a FieldComparatorSource or {@link FieldCache.Parser} was provided, it must properly implement hashCode (unless a singleton is always used).
public GetHashCode ( ) : int
Результат int

NeedsScores() публичный метод

Whether the relevance score is needed to sort documents.
public NeedsScores ( ) : bool
Результат bool

Rewrite() публичный метод

Rewrites this SortField, returning a new SortField if a change is made. Subclasses should override this define their rewriting behavior when this SortField is of type SortField.Type#REWRITEABLE
Can be thrown by the rewriting /// @lucene.experimental
public Rewrite ( IndexSearcher searcher ) : SortField
searcher IndexSearcher IndexSearcher to use during rewriting
Результат SortField

SortField() публичный метод

Creates a sort by terms in the given field, parsed to numeric values using a custom IFieldCache.Parser.
if the parser fails to /// subclass an existing numeric parser, or field is null
public SortField ( string field, Lucene.Net.Search.FieldCache parser ) : System
field string Name of field to sort by. Must not be null.
parser Lucene.Net.Search.FieldCache Instance of a , /// which must subclass one of the existing numeric /// parsers from . Sort type is inferred /// by testing which numeric parser the parser subclasses.
Результат System

SortField() публичный метод

Creates a sort, possibly in reverse, by terms in the given field, parsed to numeric values using a custom IFieldCache.Parser.
if the parser fails to /// subclass an existing numeric parser, or field is null
public SortField ( string field, FieldCache parser, bool reverse ) : System
field string Name of field to sort by. Must not be null.
parser FieldCache Instance of a , /// which must subclass one of the existing numeric /// parsers from . Sort type is inferred /// by testing which numeric parser the parser subclasses.
reverse bool True if natural order should be reversed.
Результат System

SortField() публичный метод

Creates a sort with a custom comparison function.
public SortField ( string field, FieldComparatorSource comparator ) : System
field string Name of field to sort by; cannot be null.
comparator FieldComparatorSource Returns a comparator for sorting hits.
Результат System

SortField() публичный метод

Creates a sort, possibly in reverse, with a custom comparison function.
public SortField ( string field, FieldComparatorSource comparator, bool reverse ) : System
field string Name of field to sort by; cannot be null.
comparator FieldComparatorSource Returns a comparator for sorting hits.
reverse bool True if natural order should be reversed.
Результат System

SortField() публичный метод

Creates a sort by terms in the given field with the type of term values explicitly given.
public SortField ( string field, Type_e type ) : System
field string Name of field to sort by. Can be null if /// type is SCORE or DOC.
type Type_e Type of values in the terms.
Результат System

SortField() публичный метод

Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given.
public SortField ( string field, Type_e type, bool reverse ) : System
field string Name of field to sort by. Can be null if /// type is SCORE or DOC.
type Type_e Type of values in the terms.
reverse bool True if natural order should be reversed.
Результат System

ToString() публичный метод

public ToString ( ) : string
Результат string

Описание свойств

FIELD_DOC публичное статическое свойство

Represents sorting by document number (index order).
public static SortField,Lucene.Net.Search FIELD_DOC
Результат SortField

FIELD_SCORE публичное статическое свойство

Represents sorting by document score (relevance).
public static SortField,Lucene.Net.Search FIELD_SCORE
Результат SortField

STRING_FIRST публичное статическое свойство

Pass this to #setMissingValue to have missing string values sort first.
public static object STRING_FIRST
Результат object

STRING_LAST публичное статическое свойство

Pass this to #setMissingValue to have missing string values sort last.
public static object STRING_LAST
Результат object

missingValue публичное свойство

public object missingValue
Результат object