Class GeoDistanceSortBuilder

java.lang.Object
org.elasticsearch.search.sort.SortBuilder<GeoDistanceSortBuilder>
org.elasticsearch.search.sort.GeoDistanceSortBuilder
All Implemented Interfaces:
NamedWriteable, Writeable, Rewriteable<SortBuilder<?>>, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
A geo distance based sorting on a geo point like field.
  • Field Details

  • Constructor Details

    • GeoDistanceSortBuilder

      public GeoDistanceSortBuilder(String fieldName, GeoPoint... points)
      Constructs a new distance based sort on a geo point like field.
      Parameters:
      fieldName - The geo point like field name.
      points - The points to create the range distance facets from.
    • GeoDistanceSortBuilder

      public GeoDistanceSortBuilder(String fieldName, double lat, double lon)
      Constructs a new distance based sort on a geo point like field.
      Parameters:
      fieldName - The geo point like field name.
      lat - Latitude of the point to create the range distance facets from.
      lon - Longitude of the point to create the range distance facets from.
    • GeoDistanceSortBuilder

      public GeoDistanceSortBuilder(String fieldName, String... geohashes)
      Constructs a new distance based sort on a geo point like field.
      Parameters:
      fieldName - The geo point like field name.
      geohashes - The points to create the range distance facets from.
    • GeoDistanceSortBuilder

      public GeoDistanceSortBuilder(StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details