Tablestore SDK for Java retrieves the schema, data synchronization progress, metering information, and status of a search index.
Prerequisites
Before you begin, make sure that:
You have installed the Tablestore SDK for Java and initialized the client.
The table and search index exist.
Description
Call describeSearchIndex to retrieve the configuration and status of a search index in a table.
public DescribeSearchIndexResponse describeSearchIndex(DescribeSearchIndexRequest request)
The following example queries example_index for example_table and prints the index status, synchronization phase, TTL, and field names.
String tableName = "example_table";
String indexName = "example_index";
DescribeSearchIndexRequest request = new DescribeSearchIndexRequest();
request.setTableName(tableName);
request.setIndexName(indexName);
request.setIncludeSyncStat(true);
DescribeSearchIndexResponse response = client.describeSearchIndex(request);
System.out.println(response.getIndexStatus().indexStatusEnum);
System.out.println(response.getSyncStat().getSyncPhase());
System.out.println(response.getTimeToLive());
for (FieldSchema fieldSchema : response.getSchema().getFieldSchemas()) {
System.out.println(fieldSchema.getFieldName());
}
Parameters
DescribeSearchIndexRequest contains the following parameters:
|
Name |
Type |
Description |
|
tableName (required) |
|
The table name. |
|
indexName (required) |
|
The search index name. |
|
includeSyncStat (optional) |
|
Specifies whether to return data synchronization progress. Default value: |
Response
DescribeSearchIndexResponse contains the following fields:
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
Data synchronization progress
syncStat is of the SyncStat type and contains the following fields:
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
Metering information
meteringInfo is of the MeteringInfo type and contains the following fields:
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
Query traffic weights
Each element in queryFlowWeight[] is of the QueryFlowWeight type and contains the following fields:
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
Index status
indexStatus is of the IndexStatus type and contains the following fields:
|
Field |
Type |
Description |
|
|
|
The index status. Valid values: |
|
|
|
The index status description. |