Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 8.x] Add GeohexGrid aggregation #1802

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions elasticsearch_dsl/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ class GeohashGrid(Bucket):
name = "geohash_grid"


class GeohexGrid(Bucket):
name = "geohex_grid"


class GeotileGrid(Bucket):
name = "geotile_grid"

Expand Down
6 changes: 6 additions & 0 deletions tests/test_aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
Loading