# Search Multiple indices in a cluster

**URL:** https://discuss.elastic.co/t/search-multiple-indices-in-a-cluster/196636
**Category:** Elasticsearch
**Created:** [August 24, 2019, 7:57pm UTC](https://discuss.elastic.co/t/search-multiple-indices-in-a-cluster/196636 "2019-08-24T19:57:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![krish1](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@krish1](https://discuss.elastic.co/u/krish1)
#### Post date: [August 24, 2019, 7:57pm UTC](https://discuss.elastic.co/t/search-multiple-indices-in-a-cluster/196636/1 "2019-08-24T19:57:22Z")

</div>

I have two different indices(index-1, index-2) in a cluster with the same schema. I know I can query the two indices together in a single query, so if I set in the query "size":1000 elastic search will return 1000 results from each of the indices, sort the 2000 results according to the "\_score" and return back the top 1000 documents.

However I am curious to know if there is a way to force elastic search to pick only maybe 10 documents from index-1 and the rest of the 990 documents from index-2? I am using ElasticSearch 7.1

This is the query I am using.

```
GET /index-1,index-2/_search/
{
  "query": {
    "multi_match": {
      "query": "My query",
      "fields": [
        "field_1",
        "field_2"
      ]
    }
  },
  "size": 1000
}
```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 25, 2019, 8:01am UTC](https://discuss.elastic.co/t/search-multiple-indices-in-a-cluster/196636/2 "2019-08-25T08:01:56Z")

</div>

You can do that by sending 2 separate queries at once in the same request using the [multi search API](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-multi-search.html). You can as far as I know not control that way if it is in a single query.

---

<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 22, 2019, 8:01am UTC](https://discuss.elastic.co/t/search-multiple-indices-in-a-cluster/196636/3 "2019-09-22T08:01:56Z")

</div>

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