All Products
Search
Document Center

Tablestore:Query search index information

Last Updated:Aug 06, 2026

Use Tablestore SDK for Python to query the fields, configurations, TTL, and data synchronization status of a search index.

Prerequisites

Install the Tablestore SDK for Python and initialize a client.

Description

Call describe_search_index to query the configurations and data synchronization status of a search index.

def describe_search_index(
    self,
    table_name,
    index_name,
    include_sync_stat=True,
)

The following example queries example_index for example_table and prints its TTL, index fields, and data synchronization phase.

index_meta, sync_stat = client.describe_search_index(
    "example_table",
    "example_index",
)

print(index_meta.time_to_live)
for field_schema in index_meta.fields:
    print(field_schema.field_name)

if sync_stat is not None:
    print(sync_stat.sync_phase)

Parameters

The describe_search_index method contains the following parameters.

Name

Type

Description

table_name (required)

str

The table name.

index_name (required)

str

The search index name.

include_sync_stat (optional)

bool

Specifies whether to return the data synchronization status. Default value: True. If you set this parameter to False, sync_stat in the response is None.

Response

The describe_search_index method returns a tuple that contains the following information.

Field

Type

Description

index_meta

SearchIndexMeta

The index fields, index settings, presorting settings, and TTL.

sync_stat

SyncStat

The data synchronization status. If include_sync_stat is False, this field is None.

Search index metadata

index_meta is a SearchIndexMeta object that contains the following fields.

Field

Type

Description

fields

List[FieldSchema]

The index fields. For the object structure, see Create a search index.

index_setting

IndexSetting

The index settings.

index_sort

Sort

The presorting settings.

time_to_live

int

The TTL of index data in seconds. A value of -1 indicates that the data does not expire.

Data synchronization status

sync_stat is a SyncStat object that contains the following fields.

Field

Type

Description

sync_phase

SyncPhase

The data synchronization phase. FULL indicates full synchronization, and INCR indicates incremental synchronization.

current_sync_timestamp

int

The current data synchronization timestamp.