创建多元索引后,使用UpdateSearchIndex接口可以更新多元索引信息,例如数据生命周期(TTL)。目前Node.js SDK只支持更新多元索引生命周期。
前提条件
参数
参数 | 说明 |
---|---|
tableName | 数据表名称。 |
indexName | 多元索引名称。 |
timeToLive | 多元索引生命周期。更多信息,请参见多元索引生命周期。
多元索引的TTL取值范围为-1或者int32的正整数(单位为秒),其中-1表示永久存储,int32最大值换算为年大约为68年。 |
示例
更新多元索引的数据生命周期为8000000秒。
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);
}
});