# I have two Elastic cloud indices on the same cluster both have one common field Transactionid , Can I join both indices to get combined results

**URL:** <https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915>\
**Category:** Elasticsearch\
**Created:** [June 1, 2023, 7:26am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915 "2023-06-01T07:26:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitinkapoor](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nitinkapoor](https://discuss.elastic.co/u/nitinkapoor)\
**Post date:** [June 1, 2023, 7:26am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915/1 "2023-06-01T07:26:08Z")

</div>

I have two Elastic cloud indices on the same cluster both have one common field Transactionid , Can I join both indices to get combined results

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 1, 2023, 8:38am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915/2 "2023-06-01T08:38:44Z")

</div>

Elasticsearch does not support joins so doing this at query time is generally not possible. There are workarounds that may require you to restructure your data, but in order to recommend one of these we would need to know more about the data and what you are looking to achieve.

---

<div class="post-metadata">

**Author:** ![nitinkapoor](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nitinkapoor](https://discuss.elastic.co/u/nitinkapoor)\
**Post date:** [June 3, 2023, 12:55am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915/3 "2023-06-03T00:55:58Z")

</div>

Thanks Chirstian  
My use case is as follows

I have four Tables in my MySQL database  
Order - which has order information, Shipping table with shipment information , Cancellation table with cancellation information and refund table with refund information

All four tables will have transaction id

I am getting CDC data from MYSQL to create separate indices in Elastic search  
I would like to create a dataview for Order summary which will include Transaction id and other relevant fields from order, shipment, cancellation and refund indexes

does it make sense

---

<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:** [June 3, 2023, 2:50am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915/4 "2023-06-03T02:50:38Z")

</div>

You should merge all the data before indexing in Elasticsearch and index only one document: a transaction which contains all the informations from the 4 tables.

---

<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 1, 2023, 2:51am UTC](https://discuss.elastic.co/t/i-have-two-elastic-cloud-indices-on-the-same-cluster-both-have-one-common-field-transactionid-can-i-join-both-indices-to-get-combined-results/334915/5 "2023-07-01T02:51:12Z")

</div>

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