Geo distance aggregation #
A multi-bucket aggregation like
range, but buckets are
distance rings around a geo_point origin.
Example #
Ring the Beijing area origin at 500 km:
Two places fall inside 500 km, thirteen beyond — matching the
geo_distance query answer.
Parameters for geo_distance
#
field
(Required, string)geo_pointfield you wish to aggregate.origin
(Required, object){ "lat": …, "lon": … }center point.ranges
(Required, object array) Buckets with optionalfrom/toin meters;keynames a bucket.unit/distance_type
(Optional) Distance unit andarc/planecalculation (compatibility).