# How do I combine 2 index data in elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044>\
**Category:** Elasticsearch\
**Created:** [September 11, 2019, 8:47am UTC](https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044 "2019-09-11T08:47:20Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 12, 2019, 8:30am UTC](https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044/21 "2019-09-12T08:30:22Z")

</div>

I just realised your last example complicates matters further.  
Each customer can have more than one order so the ID you are joining on is not unique - my example code assumed unique IDs.

The problem you have is denormalization - copying static reference data onto new order events.  
We have [work underway](https://github.com/elastic/elasticsearch/issues/32789) to support this in elasticsearch but it is not here yet.  
For now you'll need to write code that uses the search and indexing apis to do this fusion in your client or use an ETL tool. Logstash is a form of ETL tool and has a [lookup function](https://www.elastic.co/guide/en/logstash/current/lookup-enrichment.html#es-def) I suggest you take any related questions to the logstash forum.

---

<div class="post-metadata">

**Author:** ![mr\_searchng](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mr\_searchng](https://discuss.elastic.co/u/mr_searchng)\
**Post date:** [September 12, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044/22 "2019-09-12T13:53:23Z")

</div>

Mark now doesn't this work in elasticsearch?

---

<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:** [October 10, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044/23 "2019-10-10T13:53:27Z")

</div>

Closed on October 10, 2019, 1:53pm UTC

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

[Previous page](https://discuss.elastic.co/t/how-do-i-combine-2-index-data-in-elasticsearch/199044.md?page=1)
