# Search data from index in other index

**URL:** <https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181>\
**Category:** Kibana\
**Created:** [November 2, 2017, 11:49am UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181 "2017-11-02T11:49:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RandomDude](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@RandomDude](https://discuss.elastic.co/u/RandomDude)\
**Post date:** [November 2, 2017, 11:49am UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/1 "2017-11-02T11:49:49Z")

</div>

Hello,

If I have an index "fruit" containing names of fruits and an index dishes containing recipes, how can I request all recipes that contains fruits names ?

Thanks

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 3, 2017, 10:18am UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/2 "2017-11-03T10:18:30Z")

</div>

Hi @RandomDude,

would it be possible for you to give some more details about the structure of the "fruits" and "dishes" documents? And how would you want the result to be presented?

---

<div class="post-metadata">

**Author:** ![RandomDude](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@RandomDude](https://discuss.elastic.co/u/RandomDude)\
**Post date:** [November 3, 2017, 12:38pm UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/3 "2017-11-03T12:38:05Z")

</div>

Hi @weltenwort

I have an index "Dishes" with multiple fields. One of its fields is a text field, "recipe" that can include a fruit name.  
I have an other index "Fruits" with multiple fields. One of its fields is a text field, "name", and is a fruit name.

I would like to be able to select/visualize which Dishes have any fruit name in their recipe field.

What are possible presentations of the result ? Can it be an other index for example ?

Thank you

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [November 3, 2017, 3:33pm UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/4 "2017-11-03T15:33:52Z")

</div>

Unfortunately I don't see a way to do this in one query. I would recommend to write a small custom web app that fetches the fruits using a [`Terms` bucket aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html) and then uses the list of fruits in a [`Terms` query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html). Kibana is currently not suited for that kind of "joining".

---

<div class="post-metadata">

**Author:** ![RandomDude](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@RandomDude](https://discuss.elastic.co/u/RandomDude)\
**Post date:** [November 10, 2017, 11:19am UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/5 "2017-11-10T11:19:41Z")

</div>

Okay thanks. I think I will do the joining before feeding kibana then.

---

<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:** [December 8, 2017, 11:22am UTC](https://discuss.elastic.co/t/search-data-from-index-in-other-index/106181/6 "2017-12-08T11:22:54Z")

</div>

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