java.lang.Object
org.apache.lucene.search.SortField
org.apache.lucene.document.XYPointSortField
Sorts by distance from an origin location.
-
Nested Class Summary
Nested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true ifo
is equal to this.getComparator
(int numHits, Pruning pruning) Returns theFieldComparator
to use for sorting.Return the value to use for documents that don't have a value.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, getOptimizeSortWithIndexedData, getOptimizeSortWithPoints, getReverse, getType, needsScores, readType, rewrite, setBytesComparator, setOptimizeSortWithIndexedData, setOptimizeSortWithPoints
-
Field Details
-
x
final float x -
y
final float y
-
-
Constructor Details
-
XYPointSortField
XYPointSortField(String field, float x, float y)
-
-
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 storepruning
- controls how can the comparator to skip documents viaLeafFieldComparator.competitiveIterator()
- Returns:
FieldComparator
to use when sorting
-
getMissingValue
Description copied from class:SortField
Return the value to use for documents that don't have a value. A value ofnull
indicates that default should be used.- Overrides:
getMissingValue
in classSortField
-
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
-