Skip to content

Commit bbee5f5

Browse files
committed
Add Geo-Line aggregation
1 parent f7f85a5 commit bbee5f5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

elasticsearch_dsl/aggs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ class GeoBounds(Agg):
329329
name = "geo_bounds"
330330

331331

332+
class GeoLine(Agg):
333+
name = "geo_line"
334+
335+
332336
class Max(Agg):
333337
name = "max"
334338

tests/test_aggs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,17 @@ def test_t_test_aggregation():
334334
} == a.to_dict()
335335

336336

337+
def test_geo_line_aggregation():
338+
a = aggs.GeoLine(point={"field": "centroid"}, sort={"field": "date"})
339+
340+
assert {
341+
"geo_line": {
342+
"point": {"field": "centroid"},
343+
"sort": {"field": "date"},
344+
},
345+
} == a.to_dict()
346+
347+
337348
def test_inference_aggregation():
338349
a = aggs.Inference(model_id="model-id", buckets_path={"agg_name": "agg_name"})
339350
assert {

0 commit comments

Comments
 (0)