全部產品
Search
文件中心

Tablestore:刪除多元索引

更新時間:Apr 16, 2025

本文介紹在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);
}