Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
从向量索引中删除向量
您可以使用 DeleteVectors API 指定向量索引中的特定向量的向量键,从而删除这些向量。此操作可用于移除过时或不正确的数据,同时保留其余的向量数据。
要删除向量索引,请使用以下示例命令。将用户输入占位符替换为您自己的信息。
aws s3vectors delete-vectors \
--vector-bucket-name "amzn-s3-demo-vector-bucket" \
--index-name "idx" \
--keys '["vec2","vec3"]'
- SDK for Python
-
import boto3
# Create a S3 Vectors client in the AWS Region of your choice.
s3vectors = boto3.client("s3vectors", region_name="us-west-2")
#Delete vectors in a vector index
response = s3vectors.delete_vectors(
vectorBucketName="media-embeddings",
indexName="movies",
keys=["Star Wars", "Finding Nemo"])