> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a Search Index

> Delete a search index by ID or name, with soft/hard delete options

# Delete a Search Index

Delete a search index by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.

## Delete by ID

**id** `string` *required*

UUID of the search index to delete.

**recursive** `boolean` (default: false)

Recursively delete child entities.

**hardDelete** `boolean` (default: false)

Permanently delete the search index. If `false`, the search index is soft-deleted and can be restored.

## Delete by Name

Use `DELETE /v1/searchIndexes/name/{fqn}` to delete by fully qualified name.

**fqn** `string` *required*

Fully qualified name of the search index, for example `elasticsearch_sample.table_search_index`.

**recursive** `boolean` (default: false)

Recursively delete child entities.

**hardDelete** `boolean` (default: false)

Permanently delete the search index.

## Restore a Soft-Deleted Search Index

Use `PUT /v1/searchIndexes/restore` to restore a soft-deleted search index.

**id** `string` *required*

UUID of the soft-deleted search index to restore.

```python DELETE /v1/searchIndexes/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Soft delete by ID
SearchIndexes.delete("f5b0fa81-f241-4508-9219-dae31dcced18")

# Hard delete
SearchIndexes.delete(
    "f5b0fa81-f241-4508-9219-dae31dcced18",
    hard_delete=True
)

# Delete by name
index = SearchIndexes.retrieve_by_name("elasticsearch_sample.table_search_index")
SearchIndexes.delete(index.id)

# Delete by name with options
index = SearchIndexes.retrieve_by_name("elasticsearch_sample.table_search_index")
SearchIndexes.delete(
    index.id,
    hard_delete=True
)

# Restore a soft-deleted search index
SearchIndexes.restore("f5b0fa81-f241-4508-9219-dae31dcced18")
```

```java DELETE /v1/searchIndexes/{id} theme={null}
import java.util.Map;
import org.openmetadata.schema.entity.data.SearchIndex;

// client is an initialized OpenMetadataClient.

// Soft delete
client.searchIndexes().delete("f5b0fa81-f241-4508-9219-dae31dcced18");

// Hard delete
client.searchIndexes().delete("f5b0fa81-f241-4508-9219-dae31dcced18", Map.of("hardDelete", "true"));

// Delete by name (look up the ID first)
SearchIndex searchIndex = client.searchIndexes().getByName("elasticsearch_sample.table_search_index");
client.searchIndexes().delete(searchIndex.getId());

// Restore
client.searchIndexes().restore("f5b0fa81-f241-4508-9219-dae31dcced18");
```

```bash DELETE /v1/searchIndexes/{id} theme={null}
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18" \
  -H "Authorization: Bearer {access_token}"

# Hard delete
curl -X DELETE "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18?hardDelete=true" \
  -H "Authorization: Bearer {access_token}"

# Delete by name
curl -X DELETE "{base_url}/api/v1/searchIndexes/name/elasticsearch_sample.table_search_index" \
  -H "Authorization: Bearer {access_token}"

# Restore soft-deleted search index
curl -X PUT "{base_url}/api/v1/searchIndexes/restore" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"id": "f5b0fa81-f241-4508-9219-dae31dcced18"}'
```

```json Response (Soft Delete) theme={null}
{
  "id": "f5b0fa81-f241-4508-9219-dae31dcced18",
  "name": "table_search_index",
  "fullyQualifiedName": "elasticsearch_sample.table_search_index",
  "displayName": "TableSearchIndex",
  "version": 0.2,
  "updatedAt": 1769982670810,
  "updatedBy": "admin",
  "service": {
    "id": "search-service-id",
    "type": "searchService",
    "name": "elasticsearch_sample",
    "fullyQualifiedName": "elasticsearch_sample"
  },
  "serviceType": "ElasticSearch",
  "deleted": true,
  "owners": [],
  "tags": [],
  "domains": []
}
```

***

## Returns

Soft delete returns the search index object with `deleted: true`. Hard delete returns no content (204). Restore returns the restored search index object.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to delete this search index |
| `404` | `NOT_FOUND` | Search index with given ID or FQN does not exist |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.