Use the Tablestore SDK for Go to query the schema, synchronization status, metering information, and TTL of a search index.
Prerequisites
Install the Tablestore Go SDK and initialize a client.
Description
Call DescribeSearchIndex to query the schema and runtime information of a search index. Set IncludeSyncStat to true to return the data synchronization status.
func (client *tablestore.TableStoreClient) DescribeSearchIndex(request *tablestore.DescribeSearchIndexRequest) (*tablestore.DescribeSearchIndexResponse, error)
response, err := client.DescribeSearchIndex(&tablestore.DescribeSearchIndexRequest{
TableName: "example_table",
IndexName: "example_index",
IncludeSyncStat: proto.Bool(true),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Schema)
fmt.Println(response.SyncStat)
fmt.Println(response.TimeToLive)
Parameters
|
Name |
Type |
Description |
|
TableName (required) |
string |
The name of the data table. |
|
IndexName (required) |
string |
The name of the search index. |
|
IncludeSyncStat (optional) |
*bool |
Specifies whether to return the data synchronization status. Default value: false. |
Response
|
Name |
Type |
Description |
|
Schema |
*tablestore.IndexSchema |
The search index schema. |
|
SyncStat |
*tablestore.SyncStat |
The synchronization status. FULL indicates full synchronization, and INCR indicates incremental synchronization. |
|
MeteringInfo |
*tablestore.MeteringInfo |
The index storage size, row count, reserved read CUs, and statistics update time. |
|
QueryFlowWeights |
[]*tablestore.QueryFlowWeight |
The query traffic weights during dynamic schema modification. |
|
CreateTime |
int64 |
The index creation time. |
|
TimeToLive |
int32 |
The TTL of index data in seconds. |