# Combining fields from two indexes

**URL:** <https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659>\
**Category:** Elasticsearch\
**Created:** [June 20, 2019, 10:54am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659 "2019-06-20T10:54:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![masterThomas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/masterthomas/32/42765_2.png) [@masterThomas](https://discuss.elastic.co/u/masterThomas)\
**Post date:** [June 20, 2019, 10:54am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659/1 "2019-06-20T10:54:42Z")

</div>

hi team, i have index1 and index2. I need to get field value from index1 to transform it with field from index2 and then receive field3 as result of transforming fields from these two indexes. what the way to do it with elasticsearch API?

---

<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:** [June 20, 2019, 10:55am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659/2 "2019-06-20T10:55:38Z")

</div>

The only way to do this is in your code via two queries and a transformation job. There's nothing native to Elasticsearch that will do this sorry.

---

<div class="post-metadata">

**Author:** ![masterThomas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/masterthomas/32/42765_2.png) [@masterThomas](https://discuss.elastic.co/u/masterThomas)\
**Post date:** [June 21, 2019, 8:00am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659/3 "2019-06-21T08:00:39Z")

</div>

Thanks for the answer. Transformation job should be done with Painless or what?

---

<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:** [June 21, 2019, 11:24am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659/4 "2019-06-21T11:24:23Z")

</div>

No, in your code.

---

<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:** [July 19, 2019, 11:24am UTC](https://discuss.elastic.co/t/combining-fields-from-two-indexes/186659/5 "2019-07-19T11:24:30Z")

</div>

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