Package org.apache.lucene.document
Class FeatureSortField
java.lang.Object
org.apache.lucene.search.SortField
org.apache.lucene.document.FeatureSortField
Sorts using the value of a specified feature name from a
FeatureField
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Parses a feature field's values as float and sorts by descending valueNested classes/interfaces inherited from class org.apache.lucene.search.SortField
SortField.Provider, SortField.Type
-
Field Summary
FieldsFields inherited from class org.apache.lucene.search.SortField
FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureSortField
(String field, String featureName) Creates aFeatureSortField
that can be used to sort hits by the value of a particular feature in aFeatureField
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true ifo
is equal to this.getComparator
(int numHits, boolean enableSkipping) Returns theFieldComparator
to use for sorting.int
hashCode()
Returns a hash code for thisSortField
instance.void
setMissingValue
(Object missingValue) Set the value to use for documents that don't have a value.toString()
Methods inherited from class org.apache.lucene.search.SortField
getBytesComparator, getComparatorSource, getField, getIndexSorter, getMissingValue, getOptimizeSortWithIndexedData, getOptimizeSortWithPoints, getReverse, getType, needsScores, readType, rewrite, setBytesComparator, setOptimizeSortWithIndexedData, setOptimizeSortWithPoints
-
Field Details
-
featureName
-
-
Constructor Details
-
FeatureSortField
Creates aFeatureSortField
that can be used to sort hits by the value of a particular feature in aFeatureField
.- Parameters:
featureName
- The name of the feature to use for the sort value
-
-
Method Details
-
getComparator
Description copied from class:SortField
Returns theFieldComparator
to use for sorting.- Overrides:
getComparator
in classSortField
- Parameters:
numHits
- number of top hits the queue will storeenableSkipping
- true if the comparator can skip documents viaLeafFieldComparator.competitiveIterator()
- Returns:
FieldComparator
to use when sorting
-
setMissingValue
Description copied from class:SortField
Set the value to use for documents that don't have a value.- Overrides:
setMissingValue
in classSortField
-
hashCode
public int hashCode()Description copied from class:SortField
Returns a hash code for thisSortField
instance. If aFieldComparatorSource
was provided, it must properly implement hashCode (unless a singleton is always used). -
equals
Description copied from class:SortField
Returns true ifo
is equal to this. If aFieldComparatorSource
was provided, it must properly implement equals (unless a singleton is always used). -
toString
-