删除多元索引

本文介绍在Java SDK中如何删除多元索引。

注意事项

多元索引删除后不可恢复,请谨慎操作。

前提条件

初始化Tablestore Client

方法说明

public DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException

DeleteSearchIndexRequest参数说明

tableName String(必选):需要删除多元索引的数据表名称。

indexName String(必选):需要删除的多元索引名称。

示例代码

以下示例代码用于删除test_table中的多元索引。

运行代码前,请替换数据表名称和多元索引名称。
public static void deleteSearchIndexExample(SyncClient client) {
    DeleteSearchIndexRequest request = new DeleteSearchIndexRequest();
    // 设置数据表名称。
    request.setTableName("test_table");
    // 设置需要删除的多元索引名称。
    request.setIndexName("index_name");
    // 删除多元索引。
    client.deleteSearchIndex(request);
}