All Products
Search
Document Center

Tablestore:Delete search indexes

Last Updated:Jul 19, 2024

You can call the DeleteSearchIndex operation to delete a search index that is created for a data table.

Prerequisites

Usage notes

A search index cannot be restored after it is deleted. Exercise caution when you call this operation.

Parameters

ParameterDescription
tableNameThe name of the table.
indexNameThe name of the search index.

Example

The following sample code provides an example on how to delete a search index:

private static void deleteSearchIndex(SyncClient client) {
    DeleteSearchIndexRequest request = new DeleteSearchIndexRequest();
    request.setTableName("<TABLE_NAME>"); // Specify the name of the data table. 
    request.setIndexName("<SEARCH_INDEX_NAME>"); // Specify the name of the search index. 
    client.deleteSearchIndex(request); // Call the client to delete the search index. 
}

References

If existing search indexes do not meet your business requirements, you can create search indexes or modify the schemas of existing search indexes to add, remove, and modify indexed columns. For more information, see Create a search index and Dynamically modify the schema of a search index.