From 54eb9b41c7f7c0d3ea89c1b0f56b4d5be67fc362 Mon Sep 17 00:00:00 2001 From: Galen Date: Sun, 17 Nov 2024 17:50:01 -0800 Subject: [PATCH] create es dsl builder class for geotile_grid, re #11628 --- arches/app/search/elasticsearch_dsl_builder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arches/app/search/elasticsearch_dsl_builder.py b/arches/app/search/elasticsearch_dsl_builder.py index 9338e6a4a5b..058ebe936d8 100644 --- a/arches/app/search/elasticsearch_dsl_builder.py +++ b/arches/app/search/elasticsearch_dsl_builder.py @@ -559,6 +559,18 @@ 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) + super(GeoTileGridAgg, self).__init__(type="geotile_grid", **kwargs) + self.agg[self.name][self.type]["precision"] = self.precision + + class GeoBoundsAgg(Aggregation): """ https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html