get-vectors

Updated at:

Use the get-vectors command to retrieve specified vector data.

Permission description

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

GetVectors

oss:GetVectors

Gets vector data.

Command format

ossutil vectors-api get-vectors --bucket value --index-name value --keys value [flags]

Parameter description

Parameter

Type

Description

--bucket

string

The name of the vector bucket.

--index-name

string

The name of the index.

--keys

strings

The primary keys of the vectors to query. Duplicate primary keys are allowed. Limits:

  • Number of unique keys: 1 to 100.

  • Key length: 1 to 1,024.

--return-data

/

Specifies whether to return vector data. Vector data is returned if you omit this parameter or set it to true.

--return-metadata

/

Specifies whether to return metadata. Metadata is returned if you omit this parameter or set it to true.

Note

Usage examples

  • Retrieve the properties of vectors with the primary keys key and key1 from the index index in the examplebucket vector bucket.

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1
  • Retrieve the properties of vectors with the primary keys key and key1 from the index index in the examplebucket vector bucket, and return the vector data.

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-data
  • Retrieve the properties of vectors with the primary keys key and key1 from the index index in the examplebucket vector bucket, and return the metadata.

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-metadata
  • Retrieve the properties of vectors with the primary keys key and key1 from the index index in the examplebucket vector bucket, and return both the vector data and metadata.

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-data--return-metadata