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
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);
}