December 2017
Intermediate to advanced
434 pages
10h 29m
English
The Update API is useful for updating the existing document by ID.
The format of an update request is POST <index>/<type>/<id>/_update with a JSON request as the body:
POST /catalog/product/1/_update{ "doc": { "price": "28.99" }}
The properties specified under the "doc" element are merged into the existing document. The previous version of this document with ID 1 had price of 26.99. This update operation just updates the price and leaves the other fields of the document unchanged. This type of update means "doc" is specified and used as a partial document to merge with an existing document; there are other types of updates supported.
The response of the update request is as follows:
{ "_index": "catalog", "_type": "product", Read now
Unlock full access