创建多元索引后,使用UpdateSearchIndex接口可以更新多元索引信息,例如数据生命周期(TTL)。目前PHP SDK只支持更新多元索引生命周期。
前提条件
参数
参数 | 说明 |
---|---|
table_name | 数据表名称。 |
index_name | 多元索引名称。 |
time_to_live | 多元索引生命周期。更多信息,请参见生命周期管理。
多元索引的TTL取值范围为-1或者int32的正整数(单位为秒),其中-1表示永久存储,int32最大值换算为年大约为68年。 |
示例
更新多元索引的数据生命周期。
response = $otsClient->updateSearchIndex(array(
'table_name' => 'php_sdk_test',
'index_name' => 'test_create_search_index',
'time_to_live' => 60 * 60 * 24 * 365 * 10 //单位为秒。
));
print json_encode($response, JSON_PRETTY_PRINT);