# Questions about getting relations etc

**URL:** <https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826>\
**Category:** Elasticsearch\
**Created:** [August 23, 2012, 8:54am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826 "2012-08-23T08:54:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampfgnu](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@kampfgnu](https://discuss.elastic.co/u/kampfgnu)\
**Post date:** [August 23, 2012, 8:54am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826/1 "2012-08-23T08:54:51Z")

</div>

hi group!

we have two entities: 'Item' and 'ItemDescription'.  
the 'Item' has two properties: 'id' and 'isActive'  
the 'ItemDescription' has three properties: 'id', 'title' and 'item\_id'

is there a way to implement the following scenarios?

- when searching for text contained in ItemDescription.title, we would like  
to let elasticsearch return the 'Item' entities of the found  
'ItemDescription' entities
- return only 'Item' entities where Item.isActive = true

thanks, kampfgnu

--

---

<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:** [August 23, 2012, 9:06am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826/2 "2012-08-23T09:06:03Z")

</div>

Think "document" and not RDBMS anymore.  
Create a single type named Item and add all properties in it:  
Active  
Title

Your use case seems to be: "find items". So if you are searching for items, index items, not other stuff that you are not directly looking for.

My 2 cents.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 août 2012 à 10:54, kampfgnu [tut.ench.amok@gmail.com](mailto:tut.ench.amok@gmail.com) a écrit :

hi group!

we have two entities: 'Item' and 'ItemDescription'.  
the 'Item' has two properties: 'id' and 'isActive'  
the 'ItemDescription' has three properties: 'id', 'title' and 'item\_id'

is there a way to implement the following scenarios?

- when searching for text contained in ItemDescription.title, we would like to let elasticsearch return the 'Item' entities of the found 'ItemDescription' entities
- return only 'Item' entities where Item.isActive = true

## thanks, kampfgnu

--

---

<div class="post-metadata">

**Author:** ![kampfgnu](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@kampfgnu](https://discuss.elastic.co/u/kampfgnu)\
**Post date:** [August 23, 2012, 9:23am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826/3 "2012-08-23T09:23:28Z")

</div>

> thanks for your answer, david.

the reason we try to achieve this scenario:  
we have multilanguage support in our system.  
so the user can create an item and add multiple descriptions for it in  
different languages.  
so we split the textual description into a seperate entity ItemDescription.  
this should allow us to find the item no matter in what language the user  
searches for it.

maybe this solution to support multilanguage search results is not cool, we  
aren't sure, but can't find another solution to address this problem

greetz

--

---

<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:** [August 23, 2012, 10:58am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826/4 "2012-08-23T10:58:57Z")

</div>

I think you should look at the multifield feature. It could help for this use case.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 août 2012 à 11:23, kampfgnu [tut.ench.amok@gmail.com](mailto:tut.ench.amok@gmail.com) a écrit :

thanks for your answer, david.

the reason we try to achieve this scenario:  
we have multilanguage support in our system.  
so the user can create an item and add multiple descriptions for it in different languages.  
so we split the textual description into a seperate entity ItemDescription.  
this should allow us to find the item no matter in what language the user searches for it.

maybe this solution to support multilanguage search results is not cool, we aren't sure, but can't find another solution to address this problem

## greetz

--

---

<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 6, 2017, 3:15am UTC](https://discuss.elastic.co/t/questions-about-getting-relations-etc/8826/5 "2017-07-06T03:15:22Z")

</div>

Closed on July 6, 2017, 3:15am UTC


