Segregating elasticsearch search results

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

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