The delete-vectors command deletes specified vector data from a vector index. This command calls the DeleteVectors API operation.
The delete operation is irreversible. Deleted vector data cannot be recovered. Use this command with caution.
Prerequisites
You have installed and configured ossutil. For more information, see Install ossutil.
The vector bucket and vector index already exist.
Permissions
By default, an Alibaba Cloud account has all permissions. 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 | oss:DeleteVectors | Deletes vector data from a vector index. |
Command syntax
ossutil vectors-api delete-vectors --bucket <bucket-name> --index-name <index-name> --keys <key1,key2,...> [flags]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the vector bucket. |
--index-name | string | Yes | The name of the vector index. |
--keys | strings | Yes | A comma-separated list of vector primary keys to delete. You can specify 1 to 500 unique keys per request. If a specified primary key does not exist in the index, no error is reported and no result is returned for that key. |
For more information about the supported global command line options, see Global command line options.
Examples
Delete multiple vectors
Delete vectors with the primary keys key and key1 from the index named index in the vector bucket named examplebucket.
ossutil vectors-api delete-vectors --bucket examplebucket --index-name index --keys key,key1Delete a single vector
Delete a vector with the primary key doc-embedding-001 from the index named my-index in the vector bucket named my-vector-bucket.
ossutil vectors-api delete-vectors --bucket my-vector-bucket --index-name my-index --keys doc-embedding-001Limits
| Item | Limit |
|---|---|
| Number of keys per request | 1 to 500 |
Related commands
| Command | Description |
|---|---|
| put-vectors | Writes vector data to a vector index. |
| get-vectors | Retrieves vector data from a vector index. |
| query-vectors | Queries for similar vectors in a vector index. |