You need to enable JavaScript to run this app.
导航
deleteVikingdbIndex
最近更新时间:2025.11.03 12:22:35首次发布时间:2025.11.03 12:22:35
复制全文
我的收藏
有用
有用
无用
无用

概述

DeleteIndex 用于删除指定数据集 Collection 的指定索引 Index。

方法定义
public DeleteVikingdbIndexResponse deleteVikingdbIndex(DeleteVikingdbIndexRequest body) throws ApiException 

请求参数

参数

类型

是否必填

描述

projectName

String

项目名称

collectionName

String

2选1

数据集名称

resourceId

String

数据集资源ID。请求必须指定ResourceId和CollectionName其中之一。

indexName

String

索引名称

返回参数

参数

类型

示例值

描述

message

String

success

操作结果信息

示例

请求参数

package org.example.newsubproduct.console.index;

import com.volcengine.ApiClient;
import com.volcengine.ApiException;
import com.volcengine.sign.Credentials;
import com.volcengine.vikingdb.VikingdbApi;
import com.volcengine.vikingdb.model.*;

public class DeleteVikingdbIndex {
    public static void main(String[] args) {
        String ak = System.getenv("AK"); // ak
        String sk = System.getenv("SK"); // sk
        String endpoint = "vikingdb.cn-beijing.volcengineapi.com"; // 填写向量库控制面v2的域名  https://www.volcengine.com/docs/84313/1792715
        String region = "cn-beijing"; // 服务区域

        ApiClient apiClient = new ApiClient()
                .setEndpoint(endpoint)
                .setCredentials(Credentials.getCredentials(ak, sk))
                .setRegion(region);

        VikingdbApi api = new VikingdbApi(apiClient);

        DeleteVikingdbIndexRequest request = new DeleteVikingdbIndexRequest()
                .collectionName("test_collection_for_sdk_with_vector")
                .indexName("idx_disk");

        try {
            DeleteVikingdbIndexResponse response = api.deleteVikingdbIndex(request);
            System.out.println("response body: " + response);
            System.out.println();
            System.out.println("response meta RequestId: " + response.getResponseMetadata().getRequestId());
            System.out.println("response meta Service: " + response.getResponseMetadata().getService());
            System.out.println("response meta Region: " + response.getResponseMetadata().getRegion());
            System.out.println("response meta Action: " + response.getResponseMetadata().getAction());
            System.out.println("response meta Version: " + response.getResponseMetadata().getVersion());
        } catch (ApiException e) {
            System.out.println("exception http code: " + e.getCode());
            System.out.println("exception response body: " + e.getResponseBody());
            System.out.println();
            System.out.println("exception RequestId: " + e.getResponseMetadata().getRequestId());
            System.out.println("exception Action: " + e.getResponseMetadata().getAction());
            System.out.println("exception Region: " + e.getResponseMetadata().getRegion());
            System.out.println("exception Service: " + e.getResponseMetadata().getService());
            System.out.println("exception Error.Code: " + e.getResponseMetadata().getError().getCode());
            System.out.println("exception Error.Message: " + e.getResponseMetadata().getError().getMessage());
        }
    }
}