_parent missing during mapping - error inserting objects with parent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

_parent missing during mapping - error inserting objects with parent

kayngee
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: _parent missing during mapping - error inserting objects with parent

Binh Ly-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:

http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch/

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: _parent missing during mapping - error inserting objects with parent

kayngee
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: _parent missing during mapping - error inserting objects with parent

kayngee
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

<a href="http://127.0.0.1:9200/testcollection/elasticsearch_tests_utilityobjects_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A9200%2Ftestcollection%2Felasticsearch_tests_utilityobjects_zeepextag%2F5333df0b34bb61316092f4b0%3Fparent%3D5333de6034bb61316092f4a6\46sa\75D\46sntz\0751\46usg\75AFQjCNFJPYtrw5fICBdteIQSVWAWqkkp7w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A9200%2Ftestcollection%2Felasticsearch_tests_utilityobjects_zeepextag%2F5333df0b34bb61316092f4b0%3Fparent%3D5333de6034bb61316092f4a6\46sa\75D\46sntz\0751\46usg\75AFQjCNFJPYtrw5fICBdteIQSVWAWqkkp7w';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: _parent missing during mapping - error inserting objects with parent

kayngee
In reply to this post by kayngee
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

<a href="http://127.0.0.1:9200/testcollection/elasticsearch_tests_utilityobjects_zeepextag/5333df0b34bb61316092f4b0?parent=5333de6034bb61316092f4a6" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A9200%2Ftestcollection%2Felasticsearch_tests_utilityobjects_zeepextag%2F5333df0b34bb61316092f4b0%3Fparent%3D5333de6034bb61316092f4a6\46sa\75D\46sntz\0751\46usg\75AFQjCNFJPYtrw5fICBdteIQSVWAWqkkp7w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A9200%2Ftestcollection%2Felasticsearch_tests_utilityobjects_zeepextag%2F5333df0b34bb61316092f4b0%3Fparent%3D5333de6034bb61316092f4a6\46sa\75D\46sntz\0751\46usg\75AFQjCNFJPYtrw5fICBdteIQSVWAWqkkp7w';return true;">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 [hidden email].
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.