Multiple size attributes in a query per index

Hi,
I want to display results from two indices with same structure and put a limit of 500 records. The problem is that out of 500, I want to show 450 from index1 and 50 from index2. Is there a way in which we can achieve multiple size attributes? When doing a "size":500, it doesn't show any data from index2 when size of index1>500.

http://localhost:9200/index1,index2/_search

Thanks.

Welcome !

You need to use the multisearch API I think.

1 Like

But what if i want to sort the 500 results using custom sorting?
I am expecting this
(index1[450 recs] union index2[50 recs]) sort by custom sort;

I don't think you can

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