June 2017
Beginner to intermediate
404 pages
8h 22m
English
When you index a document with the existing document ID, it will replace the current document with the new document. As shown next, we can update the document ID 1 using the entire document:
PUT chapter4/person/1 { "id": 1, "name": "name update 1", "age": 55, "gender": "M", "email": "user1@gmail.com", "last_modified_date": "2017-02-15" }
The response is as follows:
{ "_index": "chapter4", "_type": "person", "_id": "1", "_version": 2, "result": "updated", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "created": false }
You can see from the response that the result of the operation is updated, version is 2, and created is false.
Read now
Unlock full access