Use the Tablestore SDK for Go to list the search indexes of a data table.
Prerequisites
Install the Tablestore Go SDK and initialize a client.
Description
Call ListSearchIndex to obtain the search index names of a data table.
func (client *tablestore.TableStoreClient) ListSearchIndex(request *tablestore.ListSearchIndexRequest) (*tablestore.ListSearchIndexResponse, error)
response, err := client.ListSearchIndex(&tablestore.ListSearchIndexRequest{
TableName: "example_table",
})
if err != nil {
log.Fatal(err)
}
for _, index := range response.IndexInfo {
fmt.Println(index.TableName, index.IndexName)
}
Parameters
|
Name |
Type |
Description |
|
TableName (required) |
string |
The name of the data table. |
Response
|
Name |
Type |
Description |
|
IndexInfo |
[]*tablestore.IndexInfo |
The search indexes. |
|
IndexInfo[].TableName |
string |
The data table name. |
|
IndexInfo[].IndexName |
string |
The search index name. |