I think you should use a global agg first which will use all data whatever the query. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html
1 Like