From 45947d2ba73426561f6a6c6a60c2394f620d7b55 Mon Sep 17 00:00:00 2001 From: Galen Date: Sun, 17 Nov 2024 17:46:09 -0800 Subject: [PATCH 1/3] create es dsl builder class for geotile_grid agg, re #11628 --- arches/app/search/elasticsearch_dsl_builder.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arches/app/search/elasticsearch_dsl_builder.py b/arches/app/search/elasticsearch_dsl_builder.py index 9338e6a4a5b..b5d61c62cbd 100644 --- a/arches/app/search/elasticsearch_dsl_builder.py +++ b/arches/app/search/elasticsearch_dsl_builder.py @@ -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 From af6bc7a8e1789128ae5c091f1000fb6d01423294 Mon Sep 17 00:00:00 2001 From: Galen Date: Sun, 17 Nov 2024 17:46:59 -0800 Subject: [PATCH 2/3] Revert "create es dsl builder class for geotile_grid agg, re #11628" This reverts commit 45947d2ba73426561f6a6c6a60c2394f620d7b55. revert --- arches/app/search/elasticsearch_dsl_builder.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/arches/app/search/elasticsearch_dsl_builder.py b/arches/app/search/elasticsearch_dsl_builder.py index b5d61c62cbd..9338e6a4a5b 100644 --- a/arches/app/search/elasticsearch_dsl_builder.py +++ b/arches/app/search/elasticsearch_dsl_builder.py @@ -559,21 +559,6 @@ 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 From 54eb9b41c7f7c0d3ea89c1b0f56b4d5be67fc362 Mon Sep 17 00:00:00 2001 From: Galen Date: Sun, 17 Nov 2024 17:50:01 -0800 Subject: [PATCH 3/3] 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