创建多元索引后,使用ListSearchIndex接口可以获取当前实例下或某个数据表关联的所有多元索引的列表信息。
前提条件
参数
参数 | 说明 |
---|---|
TableName | 数据表名称,可以为空。
|
示例
func ListSearchIndex(client *tablestore.TableStoreClient, tableName string) {
request := &tablestore.ListSearchIndexRequest{}
request.TableName = tableName //设置数据表名称。
resp, err := client.ListSearchIndex(request) //获取数据表关联的所有多元索引。
if err != nil {
fmt.Println("error: ", err)
return
}
for _, info := range resp.IndexInfo {
fmt.Printf("%#v\n", info) //打印多元索引的信息。
}
fmt.Println("ListSearchIndex finished, requestId:", resp.ResponseInfo.RequestId)
}