全部产品
Search
文档中心

表格存储:查询多元索引描述信息

更新时间:Sep 18, 2026

创建多元索引后,您可以查询多元索引的描述信息,例如多元索引的字段信息、索引预排序等。

接口

查询多元索引描述信息的接口为DescribeSearchIndex。

参数

参数

说明

tableName

数据表名称。

indexName

多元索引名称。

使用方式

您可以使用控制台、命令行工具或者SDK进行查询多元索引描述信息的操作。

进行查询多元索引描述信息操作之前,您需要完成如下准备工作。

使用控制台

通过控制台查看多元索引的描述信息,例如索引基本信息、索引计量、路由键、索引字段和预排序等信息。

  1. 进入索引管理页签。

    1. 登录表格存储控制台。

    2. 在页面上方,选择资源组和地域。

    3. 在概览页面,单击实例名称或在操作列单击实例管理。

    4. 在实例详情页签下的数据表列表页签,单击数据表名称或在操作列单击索引管理。

  2. 在索引管理页签,单击目标多元索引操作列的索引详情。

  3. 在索引详情对话框,即可查看索引基本信息、索引计量、路由键、索引字段和预排序等信息。

使用命令行工具

通过命令行工具执行describe_search_index命令查询多元索引描述信息。更多信息,请参见多元索引。

以下示例用于查看search_index多元索引的信息。

describe_search_index -n search_index

返回结果示例如下所示。其中为Index schema多元索引的Schema,TimeToLive为多元索引的数据生命周期。

Index schema:
{
    "IndexSetting": {
        "RoutingFields": null
    },
    "FieldSchemas": [
        {
            "FieldName": "id",
            "FieldType": "KEYWORD",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Keyword",
            "FieldType": "KEYWORD",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Long",
            "FieldType": "LONG",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Text",
            "FieldType": "TEXT",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": "single_word",
            "AnalyzerParameter": {
                "CaseSensitive": null,
                "DelimitWord": null
            },
            "EnableSortAndAgg": false,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Timestamp",
            "FieldType": "LONG",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        }
    ],
    "IndexSort": {
        "Sorters": [
            {
                "Name": "PrimaryKeySort",
                "Sorter": {
                    "Order": "ASC"
                }
            }
        ]
    }
}
TimeToLive: -1

使用SDK

您可以通过Java SDK、Go SDK、Python SDK、Node.js SDK、.NET SDK和PHP SDK查询多元索引描述信息。此处以Java SDK为例介绍查询多元索引描述信息的操作。

以下示例查询 example_table 中 example_index 的信息,并输出索引状态、同步阶段、生命周期和字段名称。

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());
}

相关文档

如果已有多元索引不满足使用需求,您可以创建新的多元索引、通过修改多元索引的Schema来增删改多元索引字段或者根据需要调整多元索引的TTL。具体操作,请参见创建多元索引、动态修改schema和生命周期管理。