final class FeatureSortField extends SortField
FeatureField
.Modifier and Type | Class and Description |
---|---|
(package private) class |
FeatureSortField.FeatureComparator
Parses a feature field's values as float and sorts by descending value
|
SortField.Type
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
featureName |
FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST
Constructor and Description |
---|
FeatureSortField(java.lang.String field,
java.lang.String featureName)
Creates a
FeatureSortField that can be used to sort hits by
the value of a particular feature in a FeatureField . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns true if
o is equal to this. |
FieldComparator<?> |
getComparator(int numHits,
int sortPos)
Returns the
FieldComparator to use for
sorting. |
int |
hashCode()
Returns a hash code for this
SortField instance. |
void |
setMissingValue(java.lang.Object missingValue)
Set the value to use for documents that don't have a value.
|
java.lang.String |
toString() |
getBytesComparator, getComparatorSource, getField, getMissingValue, getReverse, getType, needsScores, rewrite, setBytesComparator
public FeatureSortField(java.lang.String field, java.lang.String featureName)
FeatureSortField
that can be used to sort hits by
the value of a particular feature in a FeatureField
.featureName
- The name of the feature to use for the sort valuepublic FieldComparator<?> getComparator(int numHits, int sortPos)
SortField
FieldComparator
to use for
sorting.getComparator
in class SortField
numHits
- number of top hits the queue will storesortPos
- position of this SortField within 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
to use when sortingpublic void setMissingValue(java.lang.Object missingValue)
SortField
setMissingValue
in class SortField
public int hashCode()
SortField
SortField
instance. If a
FieldComparatorSource
was provided, it must properly
implement hashCode (unless a singleton is always used).public boolean equals(java.lang.Object obj)
SortField
o
is equal to this. If a
FieldComparatorSource
was provided, it must properly
implement equals (unless a singleton is always used).