By default, when indexes are deleted in an Elasticsearch cluster, the index data is deleted permanently. To prevent data loss caused by accidental deletion, CSS provides an index recycle bin. When enabled, deleted indexes are temporarily stored in the recycle bin, allowing for recovery before they are permanently removed. This feature improves data reliability and operational security.
Figure 1 How the index recycle bin works

The index recycle bin prevents permanent data loss caused by accidental index deletion. As shown in Figure 1, when the index recycle bin is enabled:
Log in to Kibana and go to the command execution page. Elasticsearch clusters support multiple access methods. This topic uses Kibana as an example to describe the operation procedures.
The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.
PUT _cluster/settings{"persistent": {"index.trash.enabled": true}}
Parameter | Type | Default Value | Description |
|---|---|---|---|
index.trash.enabled | Boolean | false | Whether to enable the index recycle bin. When the index recycle bin is enabled, deleting indexes will first move them to the recycle bin. The indexes will be permanently deleted only when they are cleared from the recycle bin. The value can be:
|
indices.trash.keep.time | String | 1d | Index retention period in the recycle bin. Expired indexes are permanently removed via a scheduled deletion task. Value format: number + unit
Minimum value: 1d |
indices.trash.clean.interval | String | 5m | Recycle bin cleanup interval. The system runs a periodic cleanup job to permanently remove expired indexes in the recycle bin. Value format: number + unit
Minimum value: 5m |
DELETE {index_name}
Parameter | Type | Default Value | Description |
|---|---|---|---|
index_name | String | N/A | Specifies one or more indexes.
|
Run the following command to view indexes in the index recycle bin to confirm index status:
GET _cat/trash?v=true&s=index
Parameter | Type | Default Value | Description |
|---|---|---|---|
v | Boolean | false | Whether the returned table will have a header. The value can be:
|
s | String | N/A | Index sorting field. The value can be:
|
format | String | None specified (table format) | The format of the returned result. Value range: json (text), yaml (text), cbor (binary), or smile (binary) If none of these four formats is specified, the result will be returned in a table. |
h | String | None specified (all) | Column names to be displayed in the returned table. If you wish to display only some of the columns, specify their names and separate them with a commas (,), for example, h=index,uuid,delete.time. |
The following is an example of the output.
index uuid pri rep trash.ts delete.timeindex1 CMD3FCLzTOyTg4RUekWNNA 1 1 1714465116615 23.6hindex1 6ATijuu6SfqamVI-WMyOKg 1 1 1714466233898 23.9h
When delete.time becomes 0, an index will be permanently deleted.
POST /trash/recover/{index_name}
GET _cat/indices?v=true
Emptying the recycle bin permanently deletes its data. Before doing that, make sure important data has been backed up.
POST trash/empty
GET _cat/trash?v=true&s=index