# Segregating elasticsearch search results

**URL:** <https://discuss.elastic.co/t/segregating-elasticsearch-search-results/244865>\
**Category:** Elasticsearch\
**Created:** [August 13, 2020, 11:12am UTC](https://discuss.elastic.co/t/segregating-elasticsearch-search-results/244865 "2020-08-13T11:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_chauhan/32/45475_2.png) [@Abhishek\_Chauhan](https://discuss.elastic.co/u/Abhishek_Chauhan)\
**Post date:** [August 13, 2020, 11:12am UTC](https://discuss.elastic.co/t/segregating-elasticsearch-search-results/244865/1 "2020-08-13T11:12:42Z")

</div>

Hello all,

I have the following query:-

i have five indexes in my ES cluster and i want to search for a term in all the indexes. As we already know that by default, ES returns 10 documents that match the term.So all the results can be from one index or from a combination of different indexes depending on whether the index has a document that matches that term most but what i want is that i get results from all indexes that match the term and not all 10 results from same index .

For e.g. let A, B , C, D, E be my indexes and i search for a term x in these indexes and all the indexes have more than 2 documents match/contain this term, so i want the results to be like this:  
A - 2 , B - 2, C - 2, D - 2, E - 2 i.e. 2 from each one of the indexes totaling 10 (default) . If one of the indexes does not contain any document then get extra documents from other indexes i.e. B- 3, C-3, D-2, E-2 in case there are no matching documents in index A.

So summing it all up, i want ES to return results coming from the indexes in an equally distributed way and also don't want to change the default no of results returned

---

<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 10, 2020, 11:12am UTC](https://discuss.elastic.co/t/segregating-elasticsearch-search-results/244865/2 "2020-09-10T11:12:44Z")

</div>

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