Geo_distance

Geo distance aggregation

/ Geo_distance, / Aggregation

Geo distance aggregation #

A multi-bucket aggregation like range, but buckets are distance rings around a geo_point origin. It answers “how many things are near me?” — counts per radius band in a single request, no matter how many rings you declare.

How it works #

Every document’s point is measured against the origin with the haversine formula on a spherical Earth (mean radius 6,371,008.8 m — within ~0.5 % of the WGS-84 ellipsoid). The origin accepts either a "lat,lon" string or a { "lat": …, "lon": … } object; an origin that parses to nothing yields zero buckets.

...