# Run aggregation separately on time based indices

**URL:** <https://discuss.elastic.co/t/run-aggregation-separately-on-time-based-indices/293981>\
**Category:** Elasticsearch\
**Created:** [January 11, 2022, 7:33am UTC](https://discuss.elastic.co/t/run-aggregation-separately-on-time-based-indices/293981 "2022-01-11T07:33:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nowrin\_Hossain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nowrin_hossain/32/99918_2.png) [@Nowrin\_Hossain](https://discuss.elastic.co/u/Nowrin_Hossain)\
**Post date:** [January 11, 2022, 7:33am UTC](https://discuss.elastic.co/t/run-aggregation-separately-on-time-based-indices/293981/1 "2022-01-11T07:33:07Z")

</div>

I have time based indices in Elasticsearch of an index and I want to run aggregation separately for every index. Is it possible ? There is any way to tell Elasticsearch not to run aggregation on whole data of all time indices in combined rather than run separately and return separate result or combined result with index specification? Mainly, I want to run terms aggregation and cardinality aggregation.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 25, 2022, 3:57pm UTC](https://discuss.elastic.co/t/run-aggregation-separately-on-time-based-indices/293981/2 "2022-01-25T15:57:46Z")

</div>

You would need to specify the indices manually, maybe a [Multi Search API](https://www.elastic.co/guide/en/elasticsearch/reference/7.16/search-multi-search.html) can help to sent the requests to different indices within a single request.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 22, 2022, 3:58pm UTC](https://discuss.elastic.co/t/run-aggregation-separately-on-time-based-indices/293981/3 "2022-02-22T15:58:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
