# How does elasticsearch limit the results of a query on multiple index search?

**URL:** <https://discuss.elastic.co/t/how-does-elasticsearch-limit-the-results-of-a-query-on-multiple-index-search/238543>\
**Category:** Elasticsearch\
**Created:** [June 24, 2020, 6:00pm UTC](https://discuss.elastic.co/t/how-does-elasticsearch-limit-the-results-of-a-query-on-multiple-index-search/238543 "2020-06-24T18:00:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amine\_Maalfi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amine_maalfi/32/62335_2.png) [@Amine\_Maalfi](https://discuss.elastic.co/u/Amine_Maalfi)\
**Post date:** [June 24, 2020, 6:00pm UTC](https://discuss.elastic.co/t/how-does-elasticsearch-limit-the-results-of-a-query-on-multiple-index-search/238543/1 "2020-06-24T18:00:49Z")

</div>

Say i queried data that is contained in 5 indexes, and the results are limited to 100 will elasticsearch search all the indexes and get 20 results from each or get 100 results from the first index it encounters?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2020, 10:06pm UTC](https://discuss.elastic.co/t/how-does-elasticsearch-limit-the-results-of-a-query-on-multiple-index-search/238543/2 "2020-06-24T22:06:43Z")

</div>

It actually works on a shard level. [https://www.elastic.co/guide/en/elasticsearch/guide/current/distributed-search.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/distributed-search.html) is old documentation (written for 2.X), but the concept is still the same.

---

<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:** [July 22, 2020, 10:06pm UTC](https://discuss.elastic.co/t/how-does-elasticsearch-limit-the-results-of-a-query-on-multiple-index-search/238543/3 "2020-07-22T22:06:47Z")

</div>

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