C# Class 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

Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Méthodes publiques

Свойство Type Description
FIELD_DOC SortField
FIELD_SCORE SortField
STRING_FIRST object
STRING_LAST object
missingValue object

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
InitFieldType ( string field, Type_e type ) : void

Method Details

Equals() public méthode

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
Résultat bool

GetComparator() public méthode

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.
Résultat FieldComparator

GetHashCode() public méthode

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
Résultat int

NeedsScores() public méthode

Whether the relevance score is needed to sort documents.
public NeedsScores ( ) : bool
Résultat bool

Rewrite() public méthode

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
Résultat SortField

SortField() public méthode

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.
Résultat System

SortField() public méthode

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.
Résultat System

SortField() public méthode

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.
Résultat System

SortField() public méthode

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.
Résultat System

SortField() public méthode

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.
Résultat System

SortField() public méthode

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.
Résultat System

ToString() public méthode

public ToString ( ) : string
Résultat string

Property Details

FIELD_DOC public_oe static_oe property

Represents sorting by document number (index order).
public static SortField,Lucene.Net.Search FIELD_DOC
Résultat SortField

FIELD_SCORE public_oe static_oe property

Represents sorting by document score (relevance).
public static SortField,Lucene.Net.Search FIELD_SCORE
Résultat SortField

STRING_FIRST public_oe static_oe property

Pass this to #setMissingValue to have missing string values sort first.
public static object STRING_FIRST
Résultat object

STRING_LAST public_oe static_oe property

Pass this to #setMissingValue to have missing string values sort last.
public static object STRING_LAST
Résultat object

missingValue public_oe property

public object missingValue
Résultat object