Update api missing _parent in response

Dear group,

Im using the update api and seems like there is no "_parent" field in response.

Steps to reproduce:

#create index
curl -XPUT localhost:9200/testindex -d '{ "mappings": { "perenttype": {}, "childtype": { "_parent": { "type": "perenttype" } } } }'
#create parent
curl localhost:9200/testindex/perenttype/1 -d '{"name" : "parentTest"}'
#create child
curl localhost:9200/testindex/childtype/2?parent=1 -d '{"name" : "childTest"}'
#execute get
curl 'localhost:9200/testindex/childtype/2?parent=1&pretty'

response:

#there is _parent field in response
{
  "_index" : "testindex",
  "_type" : "childtype",
  "_id" : "2",
  "_version" : 1,
  "_routing" : "1",
  "_parent" : "1",
  "found" : true,
  "_source" : {
    "name" : "childTest"
  }
}
#execute update
curl -XPOST 'localhost:9200/testindex/childtype/2/_update?parent=1&pretty' -d '{ "doc" : {"name" : "childTest1"} }'

response:

#there is no _parent field in response, just _id
{
  "_index" : "testindex",
  "_type" : "childtype",
  "_id" : "2",
  "_version" : 2,
  "result" : "updated",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  }
}

So the question is: How can i get parent field in update api response?

Im using elasticsearch 5.6.8

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