Class GeolocationSort

  • All Implemented Interfaces:
    SortOrder

    public class GeolocationSort
    extends Object
    implements SortOrder
    Represents a Geolocation Sort in a search request
    • Constructor Detail

      • GeolocationSort

        public GeolocationSort​(Geolocation geoLocation)
        Build a GeolocationSort from a central point
        Parameters:
        geoLocation - the centeral geolocation point
    • Method Detail

      • getCenter

        public Geolocation getCenter()
        Center point will be used to calculate the distance from that point to the field in each document, and return the results ordered by distance. Center point can be specified using any of the geolocation field formats, see geolocation fields.
        Returns:
        the center
      • getMode

        public GeolocationSort.Mode getMode()
        How to calculate distance in case a field has several geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order.
        Returns:
        the sort mode
      • setMode

        public GeolocationSort setMode​(GeolocationSort.Mode mode)
        How to calculate distance in case a field has several geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order.
        Parameters:
        mode - the sort mode
        Returns:
        this.
      • setOrder

        public GeolocationSort setOrder​(Sort.Order order)
        The sort order
        Parameters:
        order - the sort order
        Returns:
        this.