/ Delete,
/ IndexDelete an index
#
Deletes an existing index under a collection.
Examples
#
The following request deletes the index called my-index under collection
my-namespace:my-collection
DELETE /my-namespace:my-collection/_index/my-index
Request
#
DELETE /<target>/_index/<name>
Path parameters
#
<target>
(Required, string) The collection which the index will be removed from.
<name>
(Required, string) Name of the index you wish to delete.
/ Delete,
/ CollectionDelete a collection
#
Delete an existing collection.
Examples
#
The following request deletes the collection called my-collection:
Request
#
DELETE /[<namespace>:]<name>
Path Parameters
#
<namespace>
(Optional, string) The namespace which the collection belongs to.<name>
(Required, string) Name of the collection you wish to delete.
/ Delete,
/ NamespaceDelete a namespace
#
Delete an existing namespace.
Examples
#
The following request delete the namespace called website:
DELETE /_namespace/website
Request
#
DELETE /_namespace/<name>
/_ns/<name> is accepted as a shorter alias.
Path parameters
#
<name>
(Required, string) The name of the namespace that you want to delete.
Response
#
Trash semantics
#
Deleting a namespace moves the WHOLE namespace into the trash: every
collection’s data directory is retained under <data_path>/trash/
together with a namespace-level restore snapshot (one snapshot per
collection — schemas, shard UUIDs, partition routing, placements). The
sweeper physically deletes it after trash.retention_secs.
.../ Trash,
/ DeleteDelete a trash item everywhere
#
Physically delete one trash item on every node that still holds it,
without waiting for the retention window. This cannot be undone.
Examples
#
POST /_cluster/trash/1788916375_namespace-website/delete
{ "deleted": true, "item": "1788916375_namespace-website", "nodes": 2 }
Request
#
POST /_cluster/trash/<item>/delete
Path parameters
#
/ Trash,
/ DeleteEmpty the trash everywhere
#
Physically delete every trashed item on every node, without waiting for
the retention window. This cannot be undone.
Examples
#
POST /_cluster/trash/empty
{ "nodes": 2, "removed": 5 }
Request
#
POST /_cluster/trash/empty
/ Delete,
/ IndexDelete a document
#
Delete a specific document from the specified collection by specifying its unique identifier.
Examples
#
Delete the document 0,0 from collection my-collection:
DELETE /my-collection/_doc/0,0
The API returns the following result:
{
"_id": "0,0",
"_version": 0,
"result": "deleted",
...
}
Deleting a document again (or fetching it after deletion) answers
404 with "result": "not_found" — the delete itself still succeeds
and reports "result": "deleted" only for a document that was live.
...