Date range aggregation vs filters aggregation with range filter


I use date range aggregation to calculate counts for several fixed periods
(like 'today', 'this week', 'this month' & etc). This variants are shown
via radio-buttons in web interface. Also I need to add "total" variant that
counts total number of documents .

My current solution uses total document count value from some upper level
source (like upper level filter aggregation or bucket of terms
aggregation). This causes a lot of complications in my source code.

I have an idea to simplify it by replacing date range aggregation with
filters aggregation that holds range filters for my periods and matchall
filter to count total value. I wonder is there any performance problems
with this solution? What is faster to execute, date rage aggregation or
filters aggregation with range filters?

Is there any other solutions for this problem?


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit