Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

update response #749

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions 030_Data/25_Update.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.