# Limit to indices in a Query

**URL:** <https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487>\
**Category:** Elasticsearch\
**Created:** [November 13, 2018, 1:57pm UTC](https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487 "2018-11-13T13:57:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eFiiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/efiiel/32/37588_2.png) [@eFiiel](https://discuss.elastic.co/u/eFiiel)\
**Post date:** [November 13, 2018, 1:57pm UTC](https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487/1 "2018-11-13T13:57:07Z")

</div>

I'd like to know if there is a limit to the number of indices I can query using the multi-index API.

For example, if a have a cluster that create new small sized indices in a daily basis and I need to query all of them, will I have a problem when the number of indices were too high, like 500 or 1000 ?

---

<div class="post-metadata">

**Author:** ![kluvi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kluvi/32/36739_2.png) [@kluvi](https://discuss.elastic.co/u/kluvi)\
**Post date:** [November 13, 2018, 2:05pm UTC](https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487/2 "2018-11-13T14:05:45Z")

</div>

I think, that it is not good idea. The request must go to every index, that matches your pattern and then results must be merged back again...  
I recommend you to create monthly indices.. so you decrease the number of indices 30x which is much better. You can also make some app-optimizations and send request to apropriate index/indices (depending on requested date-range).

---

<div class="post-metadata">

**Author:** ![eFiiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/efiiel/32/37588_2.png) [@eFiiel](https://discuss.elastic.co/u/eFiiel)\
**Post date:** [November 13, 2018, 2:21pm UTC](https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487/3 "2018-11-13T14:21:17Z")

</div>

Thanks kluvi, and I know that this method is not by far the most optimized, but at the moment that is not a concern, what I am really seeking is if there are any API limitations about the number of indices in a query, like there is about the number of fields a doc may contain and if there is, if I can change it.

---

<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:** [December 11, 2018, 2:21pm UTC](https://discuss.elastic.co/t/limit-to-indices-in-a-query/156487/4 "2018-12-11T14:21:21Z")

</div>

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