All Products
Search
Document Center

Tablestore:Delete a search index

Last Updated:Sep 20, 2026

You can use the DeleteSearchIndex operation to delete a search index from a specified data table.

Prerequisites

API operation

/**
 * Deletes a search index.
 * @api
 *
 * @param [] $request
 *            The request parameters, which include the table name and the search index name.
 * @return [] The response to the request.
 * @throws OTSClientException Thrown if a parameter error occurs or if server-side verification fails.
 * @throws OTSServerException Thrown if the Tablestore server returns an error.
 * @example "src/examples/DeleteSearchIndex.php"
 */
public function deleteSearchIndex(array $request)

Parameters

The delete_search_index method contains the following parameters.

Name

Type

Description

table_name (required)

str

The table name.

index_name (required)

str

The search index to delete.

Example

The following example shows how to delete a search index.

$request = array(
    'table_name' => 'php_sdk_test',
    'index_name' => 'php_sdk_test_search_index'
);
$response = $otsClient->deleteSearchIndex($request);

References

If your existing search indexes do not meet your business requirements, you can create new search indexes or modify the schemas of existing search indexes to add, remove, or modify index fields. For more information, see Create a search index and Dynamically modify a schema.