Лучшее, что вы можете сделать, это установить "_source": true
. Таким образом, вы получите исходный документ.
Например,
POST test/_update/1
{
"doc":{
"hello": "world",
"hey": "there"
},
"_source": true,
"doc_as_upsert": true
}
Пример ответа:
{
"_index" : "test",
"_type" : "_doc",
"_id" : "1",
"_version" : 2,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"get" : {
"_seq_no" : 2,
"_primary_term" : 1,
"found" : true,
"_source" : {
"hello" : "world",
"hey" : "there"
}
}
}