# Joining two indexes in elasticsearch

**URL:** <https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729>\
**Category:** Elasticsearch\
**Created:** [February 11, 2020, 8:32am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729 "2020-02-11T08:32:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarvendras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sarvendras/32/46287_2.png) [@sarvendras](https://discuss.elastic.co/u/sarvendras)\
**Post date:** [February 11, 2020, 8:32am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729/1 "2020-02-11T08:32:38Z")

</div>

Hi All,  
I have one index having one column as primary key and some other fields while second index also have same primary key and some new column(which is not there in first index)  
How Can i create third index which have all fields of first index plus additonal field of second index based on primary key matching.

Since ES is nosql so cant apply joins .So Please suggest solution.Nothing i found by doing R&D.

Pls suggest.

---

<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:** [February 11, 2020, 9:01am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729/2 "2020-02-11T09:01:46Z")

</div>

I think that the new enrich processor that has been released with 7.5 will be helpful.

---

<div class="post-metadata">

**Author:** ![sarvendras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sarvendras/32/46287_2.png) [@sarvendras](https://discuss.elastic.co/u/sarvendras)\
**Post date:** [February 12, 2020, 4:48am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729/3 "2020-02-12T04:48:13Z")

</div>

Hi @dadoonet Please let us know What is the name of feature/processor which can do joining of 2 indexes based on some common id in 7.5

Thanks  
Sarvendra

---

<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:** [February 12, 2020, 6:19am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729/4 "2020-02-12T06:19:03Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-setup.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-setup.html)

You can use the reindex API to read documents from index A, define a pipeline which uses the enrich processor by looking in index B and write the result to index C.

Also read [https://www.elastic.co/blog/introducing-the-enrich-processor-for-elasticsearch-ingest-nodes](https://www.elastic.co/blog/introducing-the-enrich-processor-for-elasticsearch-ingest-nodes)

---

<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 11, 2020, 6:19am UTC](https://discuss.elastic.co/t/joining-two-indexes-in-elasticsearch/218729/5 "2020-03-11T06:19:06Z")

</div>

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