All Products
Search
Document Center

Tablestore:Delete a search index

Last Updated:Aug 19, 2024

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

Prerequisites

Precautions

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

Parameters

Parameter

Description

TableName

The name of the data table.

IndexName

The name of the search index.

Examples

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

/// <summary>
/// Delete a search index. 
/// </summary>
/// <param name="otsClient"></param>
public static void DeleteSearchIndex(OTSClient otsClient)
{
    // Specify the names of the data table and search index. 
    DeleteSearchIndexRequest request = new DeleteSearchIndexRequest(TableName, IndexName);
    // Call the client to delete the search index. 
    DeleteSearchIndexResponse response = otsClient.DeleteSearchIndex(request);
}

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 index fields. For more information, see Create search indexes and Dynamically modify the schema of a search index.