_parent missing during mapping - error inserting objects with parent


(kayngee) #1

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


(Binh Ly-2) #2

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:

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


(kayngee) #3

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

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


(kayngee) #4

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

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


(kayngee) #5

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

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


(system) #6