From 7d49fc86428d72ced419f07e3062bad7d62bcdd9 2019-03-17 17:45:10 From: Marcin Lulek Date: 2019-03-17 17:45:10 Subject: [PATCH] report stat: fix filter clause in agg --- diff --git a/backend/src/appenlight/models/services/report_stat.py b/backend/src/appenlight/models/services/report_stat.py index 0289d22..d536e23 100644 --- a/backend/src/appenlight/models/services/report_stat.py +++ b/backend/src/appenlight/models/services/report_stat.py @@ -33,10 +33,12 @@ class ReportStatService(BaseService): "aggs": { "sub_agg": {"value_count": {"field": "tags.group_id.values"}} }, - "filter": [ - {"terms": {"resource_id": [resource_id]}}, - {"exists": {"field": "tags.group_id.values"}}, - ], + "filter": { + "and": [ + {"terms": {"resource_id": [resource_id]}}, + {"exists": {"field": "tags.group_id.values"}}, + ] + }, } }, "query": {