In this section, we will discuss different ways of updating existing documents. Internally, an update is always a delete and re-index. You can update using the entire document (replacing the original document), or update a single field or add a new field, or update a field using scripts, such as incrementing a counter.
Updating your data
Update using an entire document
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"...