All Products
Search
Document Center

Tablestore:Delete a search index

Last Updated:Jan 16, 2024

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

Prerequisites

Parameters

Parameter

Description

tableName

The name of the data table.

indexName

The name of the search index.

Sample code

The following sample code provides an example on how to delete a search index that is created for the specified data table:

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

References

Tablestore also provides other methods to query data, such as secondary indexes, SQL statements, and data queries by primary key. If you no longer use search indexes, you can use secondary indexes, SQL statements, and primary key-based methods to query data. For more information, see Secondary Index, Query data in tables, and Read data.