All Products
Search
Document Center

Tablestore:Update information about search indexes

Last Updated:Aug 05, 2024

After you create a search index, you can call the UpdateSearchIndex operation to update information about the search index, such as the time to live (TTL) of the search index. Tablestore SDK for Node.js allows you to update only the TTL of search indexes.

Prerequisites

Parameters

Parameter

Description

tableName

The name of the data table.

indexName

The name of the search index.

timeToLive

The TTL of the search index. For more information, see TTL of search indexes.

The TTL of a search index is -1 or a positive int32 value in seconds. A value of -1 indicates that data in the search index never expires, and the maximum int32 value is equivalent to approximately 68 years.

Example

The following sample code provides an example on how to update the TTL of a search index to 8,000,000 seconds:


let params = {
    tableName: tableName,
    indexName: indexName,
    timeToLive: 8000000,
}
client.updateSearchIndex(params, function (err, data) {
    if (err) {
        console.log('updateSearchIndex error:', err.toString());
    } else {
        console.log('updateSearchIndex success:', data);
    }
});

References

  • If you want to query the details of 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 require a search index, you can delete the search index. For more information, see Delete search indexes.