IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Delete a document
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Delete a document
editAlright, let’s go ahead and delete the document that we added previously:
$params = [
'index' => 'my_index',
'type' => 'my_type',
'id' => 'my_id'
];
$response = $client->delete($params);
print_r($response);
You’ll notice this is identical syntax to the get syntax. The only difference is the operation: delete instead of
get. The response will confirm the document was deleted:
Array
(
[found] => 1
[_index] => my_index
[_type] => my_type
[_id] => my_id
[_version] => 2
)