All Products
Search
Document Center

Tablestore:Delete a search index

Last Updated:Apr 29, 2026

Delete a search index from a data table using Tablestore SDK for Java.

Usage notes

Deleting a search index is permanent and cannot be undone.

Prerequisites

A Tablestore client is initialized. For more information, see Initialize a Tablestore client.

Method

public DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException

DeleteSearchIndexRequest parameters

tableName String (Required): the name of the data table for which the search index was created.

indexName String (Required): the name of the search index to delete.

Sample code

The following example deletes a search index named index_name from a data table named test_table. Replace both names with your actual values before running the code.

Before you run the code, replace the table name and search index name with the actual names.
public static void deleteSearchIndexExample(SyncClient client) {
    DeleteSearchIndexRequest request = new DeleteSearchIndexRequest();
    // Specify the name of the data table.
    request.setTableName("test_table");
    // Specify the name of the search index that you want to delete.
    request.setIndexName("index_name");
    // Delete the search index.
    client.deleteSearchIndex(request);
}