After you create a search index for a data table, you can call the DescribeSearchIndex operation to query the description of the search index, including the information about fields and configurations of the search index.
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. |
indexName | The name of the search index. |
Examples
The following sample code provides an example on how to query the details of a search index, such as the time to live (TTL), creation time, synchronization status, and field information:
client.describeSearchIndex({
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:', JSON.stringify(data, null, 2));
});
References
If an existing search index no longer meets your requirements, you can create a new search index, modify the schema of the existing search index to add, remove, or modify index fields, or adjust the TTL configuration of the search index. For more information, see Create a search index, Dynamically modify the schema of a search index, and Specify the TTL of a search index.