Delete a search index
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 an existing search index does not meet your needs, you can create a new search index or modify its schema to add, delete, or change index fields. For more information, see Create a search index and Dynamically modify a schema.
In addition to search indexes, Tablestore provides the SQL engine, table engine, and secondary indexes for data queries. You can select a query method based on your scenario. For more information, see Introduction to indexes and Index selection.