# Can't specify parent if no parent field has been configured

**URL:** <https://discuss.elastic.co/t/cant-specify-parent-if-no-parent-field-has-been-configured/36741>\
**Category:** Elasticsearch\
**Created:** [December 9, 2015, 1:15pm UTC](https://discuss.elastic.co/t/cant-specify-parent-if-no-parent-field-has-been-configured/36741 "2015-12-09T13:15:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [December 9, 2015, 1:15pm UTC](https://discuss.elastic.co/t/cant-specify-parent-if-no-parent-field-has-been-configured/36741/1 "2015-12-09T13:15:25Z")

</div>

Hi to all

I have the following problem with this example suggested by the book "ElastiSearch Cookbook" in my **ElasitcSearch 2.1**

The error is: **Can't specify parent if no parent field has been configured** what's wrong?

This is the list of commands to execute:

curl -XHEAD '[http://127.0.0.1:9200/test-index?pretty=true](http://127.0.0.1:9200/test-index?pretty=true)'  
curl -XDELETE '[http://127.0.0.1:9200/test-index?pretty=true](http://127.0.0.1:9200/test-index?pretty=true)'  
curl -XPUT '[http://127.0.0.1:9200/test-index?pretty=true](http://127.0.0.1:9200/test-index?pretty=true)'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type/\_mapping?pretty=true](http://127.0.0.1:9200/test-index/test-type/_mapping?pretty=true)' -d '{"test-type": {"properties": {"pos": {"type": "integer", "store": "yes"}, "uuid": {"index": "not\_analyzed", "boost": 1.0, "store": "yes", "type": "string"}, "parsedtext": {"index": "analyzed", "term\_vector": "with\_positions\_offsets", "boost": 1.0, "store": "yes", "type": "string"}, "name": {"index": "analyzed", "term\_vector": "with\_positions\_offsets", "boost": 1.0, "store": "yes", "type": "string"}, "title": {"index": "analyzed", "term\_vector": "with\_positions\_offsets", "boost": 1.0, "store": "yes", "type": "string"}}}}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type2/\_mapping?pretty=true](http://127.0.0.1:9200/test-index/test-type2/_mapping?pretty=true)' -d '{"test-type2": {"\_parent": {"type": "test-type"}}}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type/1?pretty=true](http://127.0.0.1:9200/test-index/test-type/1?pretty=true)' -d '{"position": 1, "parsedtext": "Joe Testere nice guy", "name": "Joe Tester", "uuid": "11111", "price":4.0}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type2/1?parent=1&pretty=true](http://127.0.0.1:9200/test-index/test-type2/1?parent=1&pretty=true)' -d '{"name": "data1", "value": "value1"}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type/2?pretty=true](http://127.0.0.1:9200/test-index/test-type/2?pretty=true)' -d '{"position": 2, "parsedtext": "Bill Testere nice guy", "name": "Bill Baloney", "uuid": "22222", "price":5.0}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type2/2?parent=2&pretty=true](http://127.0.0.1:9200/test-index/test-type2/2?parent=2&pretty=true)' -d '{"name": "data2", "value": "value2"}'  
curl -XPUT '[http://127.0.0.1:9200/test-index/test-type/3?pretty=true](http://127.0.0.1:9200/test-index/test-type/3?pretty=true)' -d '{"position": 3, "parsedtext": "Bill is not\n nice guy", "name": "Bill Clinton", "uuid": "33333", "price":6.0}'  
curl -XPOST '[http://127.0.0.1:9200/test-index/\_refresh?pretty=true](http://127.0.0.1:9200/test-index/_refresh?pretty=true)'  
curl -XGET '[http://127.0.0.1:9200/\_cluster/health?wait\_for\_status=green&timeout=0s&pretty=true](http://127.0.0.1:9200/_cluster/health?wait_for_status=green&timeout=0s&pretty=true)'

---

<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, 11:32pm UTC](https://discuss.elastic.co/t/cant-specify-parent-if-no-parent-field-has-been-configured/36741/2 "2017-07-05T23:32:19Z")

</div>


