| endpoint | indices.delete |
|---|---|
| lang | javascript |
| es_version | 9.3 |
| client | @elastic/elasticsearch@9.3.0 |
Use client.indices.delete() to permanently remove an index and
all of its documents:
const response = await client.indices.delete({ index: "old_products" });
console.log(`Acknowledged: ${response.acknowledged}`);This operation is irreversible. The index and all its data are deleted immediately.
By default, deleting a non-existent index throws a
ResponseError. Use ignore_unavailable to silently skip missing
indices:
await client.indices.delete({
index: "old_products",
ignore_unavailable: true,
});