# Combining results from two indices

**URL:** <https://discuss.elastic.co/t/combining-results-from-two-indices/70118>\
**Category:** Kibana\
**Created:** [December 28, 2016, 8:42am UTC](https://discuss.elastic.co/t/combining-results-from-two-indices/70118 "2016-12-28T08:42:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_Mangipudi](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Srinivas\_Mangipudi](https://discuss.elastic.co/u/Srinivas_Mangipudi)\
**Post date:** [December 28, 2016, 8:42am UTC](https://discuss.elastic.co/t/combining-results-from-two-indices/70118/1 "2016-12-28T08:42:17Z")

</div>

I have two indices (1) CompanyOrders, (2) CompanyType

For some reason they were stored separately and CompanyOrders contains millions of results.

I need to create a visualisation in Kibana which can aggregate and split CompanyOrders data using CompanyType.

I know its better to have been able to denormalize and put CompanyType inside CompanyOrders, but unfortunately its not the current situation. Also I know we cannot join indices in ElasticSearch, so I am looking to see what is the bet possibility.

I am thinking that it should be possible to create a scripted field in CompanyOrders which can reference CompanyType field, and thus can be used in aggregation?

Is this possible?

---

<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:** [December 28, 2016, 9:01am UTC](https://discuss.elastic.co/t/combining-results-from-two-indices/70118/2 "2016-12-28T09:01:35Z")

</div>

No, it's not.

---

<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:** [January 25, 2017, 9:01am UTC](https://discuss.elastic.co/t/combining-results-from-two-indices/70118/3 "2017-01-25T09:01:56Z")

</div>

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