删除多元索引

更新时间:
复制为 MD 格式

使用表格存储 Java SDK删除指定数据表中的多元索引。

注意事项

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

前提条件

已初始化 Tablestore 客户端。详情请参见初始化Tablestore Client

方法说明

public DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException

DeleteSearchIndexRequest参数说明

tableName String(必选):数据表名称。

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

示例代码

以下示例代码删除 test_table 数据表中名为 index_name 的多元索引。运行前请将数据表名称和多元索引名称替换为实际值。

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