DELETE /v1/searchIndexes/{id}
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.getcollate.io/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")
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");
# 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"}'
{
"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": []
}
Delete a Search Index
Soft delete or permanently remove a search index entity by UUID or fully qualified name, controlling cascade behavior and maintaining audit trails via the Collate REST API.
DELETE
/
v1
/
searchIndexes
/
{id}
DELETE /v1/searchIndexes/{id}
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.getcollate.io/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")
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");
# 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"}'
{
"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": []
}
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
Permanently delete the search index. If
false, the search index is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/searchIndexes/name/{fqn} to delete by fully qualified name.
Fully qualified name of the search index, for example
elasticsearch_sample.table_search_index.Restore a Soft-Deleted Search Index
UsePUT /v1/searchIndexes/restore to restore a soft-deleted search index.
DELETE /v1/searchIndexes/{id}
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.getcollate.io/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")
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");
# 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"}'
{
"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 withdeleted: 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 |
Was this page helpful?