IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Partial document update
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Partial document update
editIf you want to partially update a document (e.g. change an existing field, or add a new one) you can do so by specifying
the doc in the body parameter. This will merge the fields in doc with the existing document.
$params = [
'index' => 'my_index',
'type' => 'my_type',
'id' => 'my_id',
'body' => [
'doc' => [
'new_field' => 'abc'
]
]
];
// Update doc at /my_index/my_type/my_id
$response = $client->update($params);