# Join multiple index to search result

**URL:** <https://discuss.elastic.co/t/join-multiple-index-to-search-result/127488>\
**Category:** Elasticsearch\
**Created:** [April 10, 2018, 1:28pm UTC](https://discuss.elastic.co/t/join-multiple-index-to-search-result/127488 "2018-04-10T13:28:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrikant\_savalkar](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@shrikant\_savalkar](https://discuss.elastic.co/u/shrikant_savalkar)\
**Post date:** [April 10, 2018, 1:28pm UTC](https://discuss.elastic.co/t/join-multiple-index-to-search-result/127488/1 "2018-04-10T13:28:02Z")

</div>

Hi,

I am using ElasticSearch ver. 6.2.3 and I have created three indexes

1. MasterSubscribers
2. CustomSubscriber1
3. CustomSubscriber2

each of these have common doc type "Subscriber"

All these indexes currently have data which we pushed from 3 SQL databases. Master may or may not have all subscribers details.  
If Subscriber is not found under 1st index then it should search under 2 & 3 index.

How can i write query for this? Can i join multiple indexes?

Thanks!

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [April 11, 2018, 4:41am UTC](https://discuss.elastic.co/t/join-multiple-index-to-search-result/127488/2 "2018-04-11T04:41:40Z")

</div>

Hi,

Do you want to join the indexes and find common fields or search for a field across indices?

If you want to search for a field across indices, you can use the `Multi-index` api to do so easily. Let me know if this helps.

[https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-index-multi-type.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-index-multi-type.html)

Regards,  
N

---

<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:** [May 9, 2018, 4:41am UTC](https://discuss.elastic.co/t/join-multiple-index-to-search-result/127488/3 "2018-05-09T04:41:45Z")

</div>

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