Use Tablestore SDK for PHP to delete a global or local secondary index without affecting the data table or its data.
Precautions
A deleted secondary index cannot be recovered. To use the index again, create a new secondary index.
API operation
/**
* Delete a global secondary index.
* @api
*
* @param [] $request
* The request parameters, including the name of the data table.
* @return [] The response.
* @throws OTSClientException Thrown when a parameter error occurs or the Tablestore server returns a verification error.
* @throws OTSServerException Thrown when the Tablestore server returns an error.
* @example "src/examples/DropIndex.php"
*/
public function dropIndex(array $request)
Parameters
|
Parameter |
Description |
|
table_name |
The name of the data table. |
|
index_name |
The name of the index table. |
Examples
The following example deletes a secondary index:
$request = array(
'table_name' => '<TABLE_NAME>', // The name of the data table.
'index_name' => '<INDEX_NAME>' // The name of the index table.
);
$otsClient->dropIndex($request);