# How to limit search result size from each index in a multi index search query?

**URL:** https://discuss.elastic.co/t/how-to-limit-search-result-size-from-each-index-in-a-multi-index-search-query/195722
**Category:** Elasticsearch
**Created:** [August 19, 2019, 11:05am UTC](https://discuss.elastic.co/t/how-to-limit-search-result-size-from-each-index-in-a-multi-index-search-query/195722 "2019-08-19T11:05:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Soumitra\_Goswami](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soumitra_goswami/32/52543_2.png) [@Soumitra\_Goswami](https://discuss.elastic.co/u/Soumitra_Goswami)
#### Post date: [August 19, 2019, 11:05am UTC](https://discuss.elastic.co/t/how-to-limit-search-result-size-from-each-index-in-a-multi-index-search-query/195722/1 "2019-08-19T11:05:59Z")

</div>

I want to query across multiple indices and for that I am currently providing the index names as comma separated values in the url. However, setting the size parameter limits the overall result size , whereas I want say n results from each index. I have tried \_msearch api but I want some aggregations on the overall result set, but with \_msearch I get multiple aggreagtions in result body( for each index provided) , is there any way to specify the limit of size of results fetched from each Index?

---

<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: [September 16, 2019, 11:06am UTC](https://discuss.elastic.co/t/how-to-limit-search-result-size-from-each-index-in-a-multi-index-search-query/195722/2 "2019-09-16T11:06:00Z")

</div>

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