# Can I use routing only for one index in multi index search?

**URL:** https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524
**Category:** Elasticsearch
**Created:** [February 7, 2019, 8:18pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524 "2019-02-07T20:18:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ramkishore31](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@ramkishore31](https://discuss.elastic.co/u/ramkishore31)
#### Post date: [February 7, 2019, 8:18pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524/1 "2019-02-07T20:18:01Z")

</div>

Hi,

I have documents split up into 2 indices. Index1 has a custom routing option(with 24 shards in total) while index2 doesn't(with 8 shards in total). When I make a search request, I want to search both the indices but will provide 4 routing strings that should hit 4 shards in index1 but search all shards of index2 with no routing? So, I want to search 12 shards in total, 4 in index1 with routing and 8 in index2 without routing. I will be using the dfs query then fetch to use global tf ids stats. Can I make a single search request to search these 12 shards and apply routing only to index1? If yes, how do I do it? If not, what are the alternative things I can do to make my use case work?

Thanks.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 7, 2019, 9:21pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524/2 "2019-02-07T21:21:43Z")

</div>

You'd have to issue two queries, there's no way to do it in one.

---

<div class="post-metadata">

### Author: ![ramkishore31](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@ramkishore31](https://discuss.elastic.co/u/ramkishore31)
#### Post date: [February 7, 2019, 10:41pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524/3 "2019-02-07T22:41:48Z")

</div>

@warkolm Even if I use two queries, how would I make sure the scoring is uniform across both? Like having a global tf idf score for both queries?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 7, 2019, 10:52pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524/4 "2019-02-07T22:52:07Z")

</div>

You just can't do it, you need to pick one or the other process.

---

<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: [March 7, 2019, 11:01pm UTC](https://discuss.elastic.co/t/can-i-use-routing-only-for-one-index-in-multi-index-search/167524/5 "2019-03-07T23:01:44Z")

</div>

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