After you create search indexes for a data table, you can call the ListSearchIndex operation to list the search indexes that are created for the 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.
Parameters
Parameter | Description |
tableName | The name of the data table. This parameter cannot be left empty. |
Examples
The following sample code provides an example on how to list search indexes that are created for a table:
client.listSearchIndex({
tableName: TABLE_NAME // Specify the name of the data table.
}, function (err, data) {
if (err) {
console.log('error:', err);
return;
}
console.log('success:', JSON.stringify(data, null, 2));
});
References
If you want to query details about a search index, such as the fields and schema of the search index, you can query the description of the search index. For more information, see Query the description of a search index.
If you no longer use a search index, you can delete the search index. For more information, see Delete a search index.