# Multiple size attributes in a query per index

**URL:** <https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440>\
**Category:** Elasticsearch\
**Created:** [January 24, 2020, 2:25pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440 "2020-01-24T14:25:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![negiadventures](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/negiadventures/32/61387_2.png) [@negiadventures](https://discuss.elastic.co/u/negiadventures)\
**Post date:** [January 24, 2020, 2:25pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440/1 "2020-01-24T14:25:36Z")

</div>

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](http://localhost:9200/index1,index2/_search)

Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 24, 2020, 2:41pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440/2 "2020-01-24T14:41:16Z")

</div>

Welcome !

You need to use the multisearch API I think.

---

<div class="post-metadata">

**Author:** ![negiadventures](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/negiadventures/32/61387_2.png) [@negiadventures](https://discuss.elastic.co/u/negiadventures)\
**Post date:** [January 24, 2020, 2:47pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440/3 "2020-01-24T14:47:34Z")

</div>

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;

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 24, 2020, 3:01pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440/4 "2020-01-24T15:01:00Z")

</div>

I don't think you can

---

<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:** [February 21, 2020, 3:01pm UTC](https://discuss.elastic.co/t/multiple-size-attributes-in-a-query-per-index/216440/5 "2020-02-21T15:01:09Z")

</div>

Closed on February 21, 2020, 3:01pm UTC

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