Yes this is correct. However, if you are not using relevance to sort the results, you can move your query to the top level filter element and put match_all into the top level query element. For example, for the following query, two histograms are returned - one with only the elements matching the query, and the other for the entire index:
{ "query": { "match_all": {} }, "filter": { // filter goes here }, "facets": { "histo_all": { "histogram": { "field": "my_field" } }, "histo": { "histogram": { "field": "my_field" }, "facet_filter": { // same filter from top-level filter goes here } } } }
source share