# Update-mapping API syntax for parent child relationship

**URL:** <https://discuss.elastic.co/t/update-mapping-api-syntax-for-parent-child-relationship/81135>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 11:34am UTC](https://discuss.elastic.co/t/update-mapping-api-syntax-for-parent-child-relationship/81135 "2017-04-04T11:34:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archi\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Archi\_Gupta](https://discuss.elastic.co/u/Archi_Gupta)\
**Post date:** [April 4, 2017, 11:34am UTC](https://discuss.elastic.co/t/update-mapping-api-syntax-for-parent-child-relationship/81135/1 "2017-04-04T11:34:57Z")

</div>

Hi,

We are using AWS Elastic Search Service.  
We have requirement to create parent - child relationship where parent index already exists.

Below link says that we can create the same using "update-mapping" API  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-mapping.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-mapping.html)

We tried below syntax but i didn't worked

curl -XPUT EndPoint/INDEXNAME/CHILDTYPE/\_mapping -d '{ "CHILDTYPE" : { "\_parent" : { "type" : "PARENTTYPE" } } }'

Error - "reason":"can't add a \_parent field that points to an already existing type"}]"

Can someone please help us with update-mapping syntax ?

Thanks,  
Archi

---

<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:** [May 2, 2017, 11:35am UTC](https://discuss.elastic.co/t/update-mapping-api-syntax-for-parent-child-relationship/81135/2 "2017-05-02T11:35:00Z")

</div>

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