Skip to content

Commit

Permalink
create es dsl builder class for geotile_grid agg, re #11628
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Nov 18, 2024
1 parent e3aeed2 commit 45947d2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arches/app/search/elasticsearch_dsl_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,21 @@ def __init__(self, **kwargs):
self.agg[self.name][self.type]["precision"] = self.precision


class GeoTileGridAgg(Aggregation):
"""
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geotilegrid-aggregation.html
"""

def __init__(self, **kwargs):
self.precision = kwargs.get("precision", 5)
self.size = kwargs.get("size", 10000)
super(GeoTileGridAgg, self).__init__(type="geotile_grid", **kwargs)
self.agg[self.name][self.type]["precision"] = self.precision
self.agg[self.name][self.type]["field"] = self.field
self.agg[self.name][self.type]["size"] = self.size


class GeoBoundsAgg(Aggregation):
"""
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html
Expand Down

0 comments on commit 45947d2

Please sign in to comment.