Geo distance aggregation

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_point field you wish to aggregate.
  • origin
    (Required, object) { "lat": …, "lon": … } center point.
  • ranges
    (Required, object array) Buckets with optional from / to in meters; key names a bucket.
  • unit / distance_type
    (Optional) Distance unit and arc/plane calculation (compatibility).
Calendar September 26, 2026
Edit Edit this page