本文介紹在Java SDK中如何刪除多元索引。
注意事項
多元索引刪除後不可恢複,請謹慎操作。
前提條件
方法說明
public DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException範例程式碼
以下範例程式碼用於刪除test_table中的多元索引。
運行代碼前,請替換資料表名稱和多元索引名稱。
public static void deleteSearchIndexExample(SyncClient client) {
DeleteSearchIndexRequest request = new DeleteSearchIndexRequest();
// 設定資料表名稱。
request.setTableName("test_table");
// 設定需要刪除的多元索引名稱。
request.setIndexName("index_name");
// 刪除多元索引。
client.deleteSearchIndex(request);
}