Skip to content

Commit 21a893a

Browse files
Telomerazgithub-actions[bot]
authored andcommitted
Add GeohexGrid aggregation (#1591)
(cherry picked from commit acd63a8)
1 parent e30129d commit 21a893a

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
@@ -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

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)