diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py index 8f91333aa..d2bfb0445 100644 --- a/elasticsearch_dsl/aggs.py +++ b/elasticsearch_dsl/aggs.py @@ -329,6 +329,10 @@ class GeoBounds(Agg): name = "geo_bounds" +class GeoLine(Agg): + name = "geo_line" + + class Max(Agg): name = "max" diff --git a/tests/test_aggs.py b/tests/test_aggs.py index 0874a66c4..191a1a564 100644 --- a/tests/test_aggs.py +++ b/tests/test_aggs.py @@ -334,6 +334,17 @@ def test_t_test_aggregation(): } == a.to_dict() +def test_geo_line_aggregation(): + a = aggs.GeoLine(point={"field": "centroid"}, sort={"field": "date"}) + + assert { + "geo_line": { + "point": {"field": "centroid"}, + "sort": {"field": "date"}, + }, + } == a.to_dict() + + def test_inference_aggregation(): a = aggs.Inference(model_id="model-id", buckets_path={"agg_name": "agg_name"}) assert {