# \_parent missing during mapping - error inserting objects with parent

**URL:** https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620
**Category:** Elasticsearch
**Created:** [March 26, 2014, 4:41pm UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620 "2014-03-26T16:41:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)
#### Post date: [March 26, 2014, 4:41pm UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/1 "2014-03-26T16:41:32Z")

</div>

Hi,

I'm trying to add a \_ parent with the following mappings but for some  
reason the \_parent field gets ignored so when I go to insert a new object  
in Elastic search I get an exception that no parent field was specified  
anyone knows why this is happening?

Regards  
Shawn

"elasticsearch\_tests\_utilityobjects\_searchableentity": {  
"properties": {

...

```
        },
      "_all": {
          "enabled": true
      }
  },
  "elasticsearch_tests_utilityobjects_zeepextag": {
      "properties": {
          "UID": {
              "type": "long"
          },
          "Type": {
              "type": "integer"
          },
          "Tag": {
              "fields": {
                  "Tag": {
                      "index_options": "offsets",
                      "type": "string",
                      "store": "yes"
                  }
              },
              "type": "multi_field"
          }
      },
      "_parent": {
          "type": "elasticsearch_tests_utilityobjects_searchableentity"
      },
      "_all": {
          "enabled": true
      }
  }

```

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2dbbc5c6-8843-4864-b5aa-aa116221afbb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2dbbc5c6-8843-4864-b5aa-aa116221afbb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)
#### Post date: [March 26, 2014, 5:42pm UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/2 "2014-03-26T17:42:15Z")

</div>

Assuming you are talking about trying to index a child document into  
elasticsearch\_tests\_utilityobjects\_zeepextag? If so, you just need to  
specify the parent id in the url when you index:

curl -XPOST  
localhost:9200/index/elasticsearch\_tests\_utilityobjects\_zeepextag?parent=parent\_id

You might find this useful:

> **[Managing Relations Inside Elasticsearch
	  	 | Elastic](https://www.elastic.co/blog/managing-relations-inside-elasticsearch)**
>
> Data in the real world is rarely simple - often times it is a jumble of interlocking relations. How do you represent relational data in Elasticsearch? There are a few mechanisms that can be used to pr...

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d7e1afe1-7890-49fb-a06c-53605b9e3442%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d7e1afe1-7890-49fb-a06c-53605b9e3442%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)
#### Post date: [March 27, 2014, 8:20am UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/3 "2014-03-27T08:20:41Z")

</div>

> That is what I am doing yet I get the following exception

[http://127.0.0.1:9200/testcollection/elasticsearch\_tests\_utilityobjects\_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6](http://127.0.0.1:9200/testcollection/elasticsearch_tests_utilityobjects_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6)

{"error":"ElasticsearchIllegalArgumentException[Can't specify parent if no  
parent field has been configured]","status":400}

Any idea what it might be?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cf7b547d-b8aa-4b23-8d97-75e7244082c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cf7b547d-b8aa-4b23-8d97-75e7244082c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)
#### Post date: [March 27, 2014, 9:22am UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/4 "2014-03-27T09:22:45Z")

</div>

Found the issue it was related to me using an incorrect index in the URL.

On Thursday, 27 March 2014 09:20:41 UTC+1, Shawn Ritchie wrote:

> That is what I am doing yet I get the following exception
> 
> > 
> 
> [http://127.0.0.1:9200/testcollection/elasticsearch\_tests\_utilityobjects\_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6](http://127.0.0.1:9200/testcollection/elasticsearch_tests_utilityobjects_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6)
> 
> {"error":"ElasticsearchIllegalArgumentException[Can't specify parent if no  
> parent field has been configured]","status":400}
> 
> Any idea what it might be?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21e446a2-41e5-4e58-a95f-6c7460c4e478%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21e446a2-41e5-4e58-a95f-6c7460c4e478%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)
#### Post date: [March 27, 2014, 10:17am UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/5 "2014-03-27T10:17:19Z")

</div>

resolved the issue was with the mapping

On Thursday, 27 March 2014 09:20:41 UTC+1, Shawn Ritchie wrote:

> That is what I am doing yet I get the following exception
> 
> > 
> 
> [http://127.0.0.1:9200/testcollection/elasticsearch\_tests\_utilityobjects\_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6](http://127.0.0.1:9200/testcollection/elasticsearch_tests_utilityobjects_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6)
> 
> {"error":"ElasticsearchIllegalArgumentException[Can't specify parent if no  
> parent field has been configured]","status":400}
> 
> Any idea what it might be?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/41295520-4f1e-47c7-8a64-e8216e3dbae6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41295520-4f1e-47c7-8a64-e8216e3dbae6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:40am UTC](https://discuss.elastic.co/t/-parent-missing-during-mapping-error-inserting-objects-with-parent/16620/6 "2017-07-06T01:40:16Z")

</div>


