Delete a search index with Tablestore SDK for Java without affecting the source table or its data.
Prerequisites
Install the Tablestore SDK for Java and initialize the client.
Description
Call deleteSearchIndex to delete a search index from a table. In the request, specify the table name and search index name.
public DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException
A deleted search index cannot be recovered. This operation deletes only the search index and does not affect the source table or its data.
The following example deletes example_index from example_table.
String tableName = "example_table";
String indexName = "example_index";
DeleteSearchIndexRequest request = new DeleteSearchIndexRequest();
request.setTableName(tableName);
request.setIndexName(indexName);
client.deleteSearchIndex(request);
After the request succeeds, call listSearchIndex to list the table's search indexes and verify that the target index is no longer returned.
Parameters
DeleteSearchIndexRequest contains the following parameters.
|
Name |
Type |
Description |
|
tableName (required) |
|
The table name. |
|
indexName (required) |
|
The name of the search index to delete. |