Skip to content

Commit dc5a835

Browse files
Telomerazmiguelgrinberg
authored andcommitted
Add GeohexGrid aggregation
1 parent f091a23 commit dc5a835

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

elasticsearch_dsl/aggs.py

+4
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ class GeohashGrid(Bucket):
209209
name = "geohash_grid"
210210

211211

212+
class GeohexGrid(Bucket):
213+
name = "geohex_grid"
214+
215+
212216
class GeotileGrid(Bucket):
213217
name = "geotile_grid"
214218

tests/test_aggs.py

+6
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ def test_geohash_grid_aggregation():
262262
assert {"geohash_grid": {"field": "centroid", "precision": 3}} == a.to_dict()
263263

264264

265+
def test_geohex_grid_aggregation():
266+
a = aggs.GeohexGrid(**{"field": "centroid", "precision": 3})
267+
268+
assert {"geohex_grid": {"field": "centroid", "precision": 3}} == a.to_dict()
269+
270+
265271
def test_geotile_grid_aggregation():
266272
a = aggs.GeotileGrid(**{"field": "centroid", "precision": 3})
267273

0 commit comments

Comments
 (0)