Deletes specified vector data from a vector index.
Notes
-
You can delete vector data in batches.
-
The delete operation is irreversible. Use this command with caution.
Permissions
An Alibaba Cloud account has all permissions by default. A Resource Access Management (RAM) user or RAM role has no permissions by default. The Alibaba Cloud account or an administrator must grant permissions using a RAM policy or a bucket policy.
|
API |
Action |
Description |
|
DeleteVectors |
|
Deletes vector data. |
Request syntax
POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou-internal.oss-vectors.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Content-type: application/json
{
"indexName": "string",
"keys": [string, string, string]
}
Request headers
This operation uses only common request headers. For more information, see Common HTTP headers.
Request parameters
|
Name |
Data type |
Required |
Example |
Description |
|
indexName |
string |
No |
vectorindex1 |
The name of the index. |
|
keys |
container |
Yes |
["doc-001", "doc-002"] |
A list of vector primary keys. No error is reported if a vector for a specified primary key does not exist. Constraint: The number of unique keys must be in the range [1, 500]. |
This operation also uses common request headers. For more information, see Common HTTP headers.
Response headers
This operation uses only common response headers. For more information, see Common HTTP headers.
Examples
Request example
POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou-internal.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"]
}
Response example
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
SDK
DeleteVectors is available in the following SDKs:
ossutil command line interface
For the corresponding ossutil command, see delete-vectors.
Error codes
|
Error code |
HTTP status code |
Description |
|
VectorIndexParameterInvalid |
400 |
The request contains an invalid vector index parameter. |
|
MalformedJson |
400 |
The request body contains malformed JSON. |
|
AccessDenied |
403 |
This error may be returned for the following reasons:
|
|
NoSuchVectorIndex |
404 |
The specified vector index does not exist. |
|
QpsLimitExceeded |
503 |
The queries per second (QPS) limit is exceeded. If the HTTP status code is 5xx, only some data in the batch request may be deleted. The write operation does not ensure atomicity. |