全部產品
Search
文件中心

Object Storage Service:DeleteVectors

更新時間:Sep 25, 2025

調用DeleteVectors介面刪除向量索引中的指定向量資料。

注意事項

  • 支援大量刪除向量資料。

  • 刪除操作無法復原,請謹慎操作。

許可權說明

阿里雲帳號預設擁有全部許可權。阿里雲帳號下的RAM使用者或RAM角色預設沒有任何許可權,需要阿里雲帳號或帳號管理員通過RAM PolicyBucket Policy授予操作許可權。

API

Action

說明

DeleteVectors

oss:DeleteVectors

刪除向量資料。

請求文法

POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Content-type: application/json

{
   "indexName": "string",
   "keys": [string, string, string]
}

要求標頭

此介面僅涉及公用要求標頭。更多資訊,請參見公用HTTP頭定義

請求參數

名稱

資料類型

是否必選

樣本值

描述

indexName

字串

vectorindex1

索引名稱。

keys

容器

["doc-001", "doc-002"]

向量主鍵列表。如果要刪除的主鍵對應的向量不存在,不會報錯。

限制:去重key數量 ∈ [1, 500]

此介面還需要包含公用要求標頭。更多資訊,請參見公用HTTP頭定義

回應標頭

此介面僅涉及公用回應標頭。更多資訊,請參見公用HTTP頭定義

樣本

請求樣本

POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: Thu, 17 Apr 2025 01:33:47 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218
Content-type: application/json

{
   "indexName": "vectorindex1",
   "keys": ["doc-001", "doc-002", "doc-003"]
}

返回樣本

HTTP/1.1 204 No Content
x-oss-request-id: 534B371674E88A4D8906****
Date: Thu, 17 Apr 2025 01:33:47 GMT
Connection: keep-alive
Server: AliyunOSS

錯誤碼

錯誤碼

HTTP狀態代碼

描述

VectorIndexParameterInvalid

400

請求中提供的向量索引參數不合法。

MalformedJson

400

請求體中的 JSON 格式不符合規範。

AccessDenied

403

返回該錯誤的可能原因如下:

  • 發起請求時沒有傳入使用者驗證資訊。

  • 沒有操作許可權。

NoSuchVectorIndex

404

指定的向量索引不存在。

QpsLimitExceeded

503

QPS 限流(請求速率受限)。當 HTTP 狀態代碼為 5xx 時,可能在同一批請求中只有部分資料刪除成功,寫入不具備原子性。