Class XYPointSortField


  • final class XYPointSortField
    extends SortField
    Sorts by distance from an origin location.
    • Field Detail

      • x

        final float x
      • y

        final float y
    • Constructor Detail

      • XYPointSortField

        XYPointSortField​(java.lang.String field,
                         float x,
                         float y)
    • Method Detail

      • getComparator

        public FieldComparator<?> getComparator​(int numHits,
                                                int sortPos)
        Description copied from class: SortField
        Returns the FieldComparator to use for sorting.
        Overrides:
        getComparator in class SortField
        Parameters:
        numHits - number of top hits the queue will store
        sortPos - 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.
        Returns:
        FieldComparator to use when sorting
      • getMissingValue

        public java.lang.Double getMissingValue()
        Description copied from class: SortField
        Return the value to use for documents that don't have a value. A value of null indicates that default should be used.
        Overrides:
        getMissingValue in class SortField
      • setMissingValue

        public void setMissingValue​(java.lang.Object missingValue)
        Description copied from class: SortField
        Set the value to use for documents that don't have a value.
        Overrides:
        setMissingValue in class SortField
      • hashCode

        public int hashCode()
        Description copied from class: SortField
        Returns a hash code for this SortField instance. If a FieldComparatorSource was provided, it must properly implement hashCode (unless a singleton is always used).
        Overrides:
        hashCode in class SortField
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from class: SortField
        Returns true if o is equal to this. If a FieldComparatorSource was provided, it must properly implement equals (unless a singleton is always used).
        Overrides:
        equals in class SortField
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class SortField