java.lang.Object
org.apache.lucene.search.SortField
org.apache.lucene.document.LatLonPointSortField
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
FieldsModifier and TypeFieldDescription(package private) final double
(package private) final double
Fields 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, boolean enableSkipping) 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
-
latitude
final double latitude -
longitude
final double longitude
-
-
Constructor Details
-
LatLonPointSortField
LatLonPointSortField(String field, double latitude, double longitude)
-
-
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
-
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
-