diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py index d9412e26..69c2d85e 100644 --- a/elasticsearch_dsl/aggs.py +++ b/elasticsearch_dsl/aggs.py @@ -209,6 +209,10 @@ class GeohashGrid(Bucket): name = "geohash_grid" +class GeohexGrid(Bucket): + name = "geohex_grid" + + class GeotileGrid(Bucket): name = "geotile_grid" diff --git a/tests/test_aggs.py b/tests/test_aggs.py index 936c2bcd..aa928de4 100644 --- a/tests/test_aggs.py +++ b/tests/test_aggs.py @@ -262,6 +262,12 @@ def test_geohash_grid_aggregation(): assert {"geohash_grid": {"field": "centroid", "precision": 3}} == a.to_dict() +def test_geohex_grid_aggregation(): + a = aggs.GeohexGrid(**{"field": "centroid", "precision": 3}) + + assert {"geohex_grid": {"field": "centroid", "precision": 3}} == a.to_dict() + + def test_geotile_grid_aggregation(): a = aggs.GeotileGrid(**{"field": "centroid", "precision": 3})