# How to disassociate parent-child relationship through re-indexing

**URL:** <https://discuss.elastic.co/t/how-to-disassociate-parent-child-relationship-through-re-indexing/61463>\
**Category:** Elasticsearch\
**Created:** [September 25, 2016, 11:31am UTC](https://discuss.elastic.co/t/how-to-disassociate-parent-child-relationship-through-re-indexing/61463 "2016-09-25T11:31:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Vaid](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Abhishek\_Vaid](https://discuss.elastic.co/u/Abhishek_Vaid)\
**Post date:** [September 25, 2016, 11:31am UTC](https://discuss.elastic.co/t/how-to-disassociate-parent-child-relationship-through-re-indexing/61463/1 "2016-09-25T11:31:55Z")

</div>

- I have a index with parent-child relationship. A type is the parent of C type. I want to reindex C type documents into its own index. I'm doing this through reindex API. When I run the command, I get following error:

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "illegal\_argument\_exception",  
> "reason": "Can't specify parent if no parent field has been configured"  
> }  
> ],  
> "type": "illegal\_argument\_exception",  
> "reason": "Can't specify parent if no parent field has been configured"  
> },  
> "status": 400  
> }

- I want to get rid of parent references in Child type.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [September 25, 2016, 1:57pm UTC](https://discuss.elastic.co/t/how-to-disassociate-parent-child-relationship-through-re-indexing/61463/2 "2016-09-25T13:57:57Z")

</div>

Reindex supports removing the parent but you'd need to do with a script like `ctx._parent=null`.

---

<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 5, 2017, 10:17pm UTC](https://discuss.elastic.co/t/how-to-disassociate-parent-child-relationship-through-re-indexing/61463/3 "2017-07-05T22:17:27Z")

</div>


