You can call the DeleteSearchIndex operation to delete a search index that is created for a data table.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A data table is created and data is written to the data table. For more information, see Create data tables and Write data.
A search index is created for the data table. For more information, see Create a search index.
Usage notes
A deleted search index cannot be recovered. Proceed with caution.
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:
client.deleteSearchIndex({
tableName: TABLE_NAME, // Specify the name of the data table.
indexName: INDEX_NAME // Specify the name of the search index.
}, function (err, data) {
if (err) {
console.log('error:', err);
return;
}
console.log('success:', data);
});
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 a search index and Dynamically modify the schema of a search index.