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) classParses 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 aFeatureSortFieldthat can be used to sort hits by the value of a particular feature in aFeatureField. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true ifois equal to this.getComparator(int numHits, Pruning pruning) Returns theFieldComparatorto use for sorting.inthashCode()Returns a hash code for thisSortFieldinstance.voidsetMissingValue(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 aFeatureSortFieldthat 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:SortFieldReturns theFieldComparatorto use for sorting.- Overrides:
getComparatorin classSortField- Parameters:
numHits- number of top hits the queue will storepruning- controls how can the comparator to skip documents viaLeafFieldComparator.competitiveIterator()- Returns:
FieldComparatorto use when sorting
-
setMissingValue
Description copied from class:SortFieldSet the value to use for documents that don't have a value.- Overrides:
setMissingValuein classSortField
-
hashCode
public int hashCode()Description copied from class:SortFieldReturns a hash code for thisSortFieldinstance. If aFieldComparatorSourcewas provided, it must properly implement hashCode (unless a singleton is always used). -
equals
Description copied from class:SortFieldReturns true ifois equal to this. If aFieldComparatorSourcewas provided, it must properly implement equals (unless a singleton is always used). -
toString
-