Citadel: Fix range aggregations

This commit is contained in:
Adrian Moennich 2021-05-18 17:37:11 +02:00
parent 967e146344
commit f1a0da71e0

View File

@ -156,7 +156,8 @@ def format_aggregations(aggregations, filters):
'label': str(filters[key]),
'buckets': [{
'key': bucket['most_common']['buckets'][0]['key'] if 'most_common' in bucket else bucket['key'],
'count': bucket['doc_count']
'count': bucket['doc_count'],
**{k: v for k, v in bucket.items() if k in ('from_as_string', 'to_as_string')}
} for bucket in value['buckets']]
}
for key, value in _flatten(aggregations)