# Get parent via child without parent id

**URL:** <https://discuss.elastic.co/t/get-parent-via-child-without-parent-id/185629>\
**Category:** Elasticsearch\
**Created:** [June 13, 2019, 11:46am UTC](https://discuss.elastic.co/t/get-parent-via-child-without-parent-id/185629 "2019-06-13T11:46:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ernesto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ernesto/32/48073_2.png) [@Ernesto](https://discuss.elastic.co/u/Ernesto)\
**Post date:** [June 13, 2019, 11:46am UTC](https://discuss.elastic.co/t/get-parent-via-child-without-parent-id/185629/1 "2019-06-13T11:46:48Z")

</div>

I am new to elasticsearch, but can not find the information about one issue which is:

Imagine:

You have Entity A and it has mapping to Entity B (for example ManyToOne), but Entity B has no mapping to Entity A. I am speaking here about Relationship mapping annotations.

Basically A knows about B, but B does not know about A. How to then search something via ElasticSearch when you have some part of entity B and you would like to find entity A by this part from B?

Do I have to provide mapping in entity B to A, or there is a way to find by entity B, relation to entity A.

I hope I explained my concern clearly...

Regards

---

<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 11, 2019, 11:46am UTC](https://discuss.elastic.co/t/get-parent-via-child-without-parent-id/185629/2 "2019-07-11T11:46:55Z")

</div>

Closed on July 11, 2019, 11:46am UTC

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