The put-vector-index command creates a vector index in a vector bucket.
Notes
A single vector bucket can contain up to 100 vector indexes.
-
A maximum of 5 PutVectorIndex requests are supported per second.
Permissions
By default, Alibaba Cloud accounts have all permissions, whereas Resource Access Management (RAM) users and RAM roles have no permissions. The Alibaba Cloud account or an administrator must grant permissions through a RAM policy or a bucket policy.
|
API |
Action |
Description |
|
PutVectorIndex |
|
Creates a vector index. |
Command format
ossutil vectors-api put-vector-index --bucket value --index-name value [flags]Parameters
|
Parameter |
Type |
Description |
|
--bucket |
string |
The name of the vector bucket. |
|
--data-type |
string |
The data type of the vector. Custom data types are not supported. Default value: float32. |
|
--dimension |
int |
The vector dimensions. The value can be an integer from 1 to 4096. The default value is 512. |
|
--distance-metric |
string |
The distance measure function. Valid values:
|
|
--index-name |
string |
The name of the index. You can specify a custom name. The default value is empty.
|
|
--metadata |
string | The container for metadata configuration. Only non-filterable metadata is supported. The following limits apply to the configuration of non-filterable metadata:
|
-
The put-vector-index command corresponds to the PutVectorIndex API operation.
-
For more information about the supported global command-line options, see Supported global command-line options.
Usage examples
-
Create an index named
indexfor theexamplebucketbucket. The index has 512 vector dimensions, uses the float32 data type, and the euclidean distance measure.ossutil vectors-api put-vector-index --bucket examplebucket --index-name index --data-type float32 --dimension 512 --distance-metric euclidean -
Create an index named
indexfor theexamplebucketbucket and configure non-filterable metadata. The index has 512 vector dimensions, uses the float32 data type, and the euclidean distance measure.ossutil vectors-api put-vector-index --bucket examplebucket --index-name index --data-type float32 --dimension 512 --distance-metric euclidean --metadata '{"nonFilterableMetadataKeys":["owner","createdBy"]}'