I am trying to get the count of documents that were created for the last 10 weeks grouped by week. To get the count for the last week, I would do something like this
But If I wanted the count for every week of the last 10 weeks, should I fire 10 queries with different gte and lte values? Or is there any way to do this in a single query?
Thank you:) and thanks for the suggestion. I did not know about Date Range Aggregation. I gave it a shot and this comes close to what I was looking for. Though, it returns all the documents along with the aggregations. Is there a way to make it not documents and make it return only the aggregations?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.