put-vector-index-fusion
The put-vector-index-fusion command creates a Fusion-mode vector index in a vector bucket.
Fusion Mode is currently in invitational preview and is available only in the Indonesia (Jakarta) region. For creating a vector index in Standard Mode, see put-vector-index.
Permissions
By default, an Alibaba Cloud account has full permissions. In contrast, RAM users and RAM roles have no permissions and must be granted access by an account owner or administrator through a RAM Policy or a Bucket Policy.
API | Action | Description |
PutVectorIndexFusion |
| Creates a Fusion-mode vector index. |
Command format
ossutil vectors-api put-vector-index-fusion --bucket value --index-name value --vector-mode value --schema-configuration value --account-id valueParameters
Parameter | Type | Description |
--account-id | string | The ID of the Alibaba Cloud account. This option is required. If it is not specified, the command returns the |
--bucket | string | The name of the vector bucket. |
--index-name | string | The name of the vector index. |
--vector-mode | string | The mode of the vector index. Set the value to |
--schema-configuration | string | The schema configuration of the vector index, in JSON format. If the option value contains the |
--schema-configuration
The --schema-configuration option supports JSON syntax. If the option value contains the file:// prefix, the configuration is read from the specified file. The JSON syntax is as follows:
{
"fields": [
{
"name": "string",
"type": "vector",
"dataType": "float32",
"dimension": int,
"distanceMetric": "euclidean"
},
{
"name": "string",
"type": "long",
"isArray": bool
},
{
"name": "string",
"type": "double",
"isArray": bool
},
{
"name": "string",
"type": "ip"
},
{
"name": "string",
"type": "geoPoint"
},
{
"name": "string",
"type": "string",
"isPartitionKey": bool
},
{
"name": "string",
"type": "string",
"exactMatch": bool,
"text": {
"enabled": bool,
"analyzer": "standard",
"analyzerParameters": {
"caseSensitive": bool,
"delimitWord": bool
}
}
},
{
"name": "string",
"type": "string",
"exactMatch": bool,
"text": {
"enabled": bool,
"analyzer": "split",
"analyzerParameters": {
"caseSensitive": bool,
"delimiter": "string"
}
}
}
]
}This command requires ossutil 2.4.1 or later. For earlier versions, call the PutVectorIndexFusion operation by using the
invoke-operationgeneric command.For more information about the supported global command-line options, see Supported global command-line options.
Usage examples
Create a Fusion-mode vector index named my_index in the vector bucket named examplebucket.
Method 1: Read the schema configuration from a JSON file. The following example shows the content of the schema-configuration.json file:
{
"fields": [
{
"name": "text_vector",
"type": "vector",
"dataType": "float32",
"dimension": 4,
"distanceMetric": "cosine"
},
{
"name": "image_vector",
"type": "vector",
"dataType": "float32",
"dimension": 4,
"distanceMetric": "cosine"
},
{
"name": "title",
"type": "string",
"exactMatch": false,
"text": {
"enabled": true,
"analyzer": "standard",
"analyzerParameters": {
"caseSensitive": false,
"delimitWord": false
}
}
},
{
"name": "category",
"type": "string",
"isArray": true
},
{
"name": "year",
"type": "long"
}
]
}ossutil vectors-api put-vector-index-fusion --bucket examplebucket --index-name my_index --vector-mode fusion --schema-configuration file://schema-configuration.json --account-id 123456789012****Method 2: Pass the JSON string directly on the command line.
ossutil vectors-api put-vector-index-fusion --bucket examplebucket --index-name my_index --vector-mode fusion --schema-configuration '{"fields":[{"name":"text_vector","type":"vector","dataType":"float32","dimension":4,"distanceMetric":"cosine"},{"name":"image_vector","type":"vector","dataType":"float32","dimension":4,"distanceMetric":"cosine"},{"name":"title","type":"string","exactMatch":false,"text":{"enabled":true,"analyzer":"standard","analyzerParameters":{"caseSensitive":false,"delimitWord":false}}},{"name":"category","type":"string","isArray":true},{"name":"year","type":"long"}]}' --account-id 123456789012****