Skip to content

Commit f82b624

Browse files
committed
Add GeohexGrid aggregation
1 parent 477eb08 commit f82b624

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

elasticsearch_dsl/aggs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ class GeohashGrid(Bucket):
212212
name = "geohash_grid"
213213

214214

215+
class GeohexGrid(Bucket):
216+
name = "geohex_grid"
217+
218+
215219
class GeotileGrid(Bucket):
216220
name = "geotile_grid"
217221

tests/test_aggs.py

Lines changed: 6 additions & 0 deletions
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)