From f6255f64eba1ee86ab376c4176b8fecef70e9735 Mon Sep 17 00:00:00 2001 From: Kurt Hurtado Date: Tue, 30 Jan 2018 21:41:41 -0800 Subject: [PATCH] update response --- 030_Data/25_Update.asciidoc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/030_Data/25_Update.asciidoc b/030_Data/25_Update.asciidoc index ae13d16a7..f399b52ec 100644 --- a/030_Data/25_Update.asciidoc +++ b/030_Data/25_Update.asciidoc @@ -23,15 +23,21 @@ number: [source,js] -------------------------------------------------- { - "_index" : "website", - "_type" : "blog", - "_id" : "123", - "_version" : 2, - "created": false <1> + "_index": "website", + "_type": "blog", + "_id": "123", + "_version": 2, + "result": "updated", <1> + "_shards": { + "total": 2, + "successful": 1, + "failed": 0 + }, + "_seq_no": 1, + "_primary_term": 1 } -------------------------------------------------- -<1> The `created` flag is((("created flag"))) set to `false` because a document with the same - index, type, and ID already existed. +<1> The `result` flag returns the result of the operation. Internally, Elasticsearch has marked the old document as deleted and added an entirely new document.((("deleted documents"))) The old version of the document doesn't disappear @@ -50,4 +56,3 @@ same process as described previously: The only difference is that the `update` API achieves this through a single client request, instead of requiring separate `get` and `index` requests. -