# Setting up parent relationship

**URL:** <https://discuss.elastic.co/t/setting-up-parent-relationship/11080>\
**Category:** Elasticsearch\
**Created:** [March 8, 2013, 11:12pm UTC](https://discuss.elastic.co/t/setting-up-parent-relationship/11080 "2013-03-08T23:12:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganican](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ganican/32/2435_2.png) [@ganican](https://discuss.elastic.co/u/ganican)\
**Post date:** [March 8, 2013, 11:12pm UTC](https://discuss.elastic.co/t/setting-up-parent-relationship/11080/1 "2013-03-08T23:12:03Z")

</div>

I used the following script to set parent for my couchdb doc with a field  
"parent":

_if(ctx.doc.parent) ctx.\_parent = ctx.doc.parent_

But some how I didnt see any field "\_parent" in the actual index. Is the  
above script right syntax?

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:47am UTC](https://discuss.elastic.co/t/setting-up-parent-relationship/11080/2 "2017-07-06T02:47:25Z")

</div>


