# Setting parent child relation

**URL:** <https://discuss.elastic.co/t/setting-parent-child-relation/189322>\
**Category:** Elasticsearch\
**Created:** [July 8, 2019, 10:14am UTC](https://discuss.elastic.co/t/setting-parent-child-relation/189322 "2019-07-08T10:14:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinit\_Pillai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinit_pillai/32/46749_2.png) [@Vinit\_Pillai](https://discuss.elastic.co/u/Vinit_Pillai)\
**Post date:** [July 8, 2019, 10:14am UTC](https://discuss.elastic.co/t/setting-parent-child-relation/189322/1 "2019-07-08T10:14:04Z")

</div>

I'm using indexRequestBuilder and I want to use setParent(). I have to migrate a code which was written on ES 5.4.0. where setParent() was present. but now I'm using 7.2.0 Where the parent field has been replaced with join datatype. I've read the docs but am unable to understand how to achieve this.  
Should I use setSource() and provide a map with properties? can anyone provide me an example for this in java?

---

<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:** [August 5, 2019, 10:14am UTC](https://discuss.elastic.co/t/setting-parent-child-relation/189322/2 "2019-08-05T10:14:07Z")

</div>

Closed on August 5, 2019, 10:14am UTC

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