Combining Range and Histogram Filter in ElasticSearch
You can combine facets for different colors into the same request using facet_filter:
{ "facets": { "freq_red": { "date_histogram": { "interval": "day", "field": "timestamp" }, "facet_filter": { "term": { "color": "red" } } }, "freq_green": { "date_histogram": { "interval": "day", "field": "timestamp" }, "facet_filter": { "term": { "color": "green" } } } }}