文档中心 对象存储(KS3) 常用工具 工具汇总 KS3Util命令行工具 KS3 Vectors 命令 向量索引 create-index

create-index

最近更新时间:2026-11-11 10:30:20

create-index 命令用于创建向量索引。

命令格式

ks3util vectors-api create-index --vector-bucket-name value --index-name value --dimension value --distance-metric value [options]

参数说明

参数

说明

--vector-bucket-name

向量桶名称。

--vector-bucket-krn

向量桶 KRN,与 --vector-bucket-name 二选一。

--index-name

向量索引名称。

--data-type

向量数据类型,默认 float32。

--dimension

向量维度,取值范围 1-4096。

--distance-metric

距离度量函数,可选值:euclidean(欧氏距离)、cosine(余弦距离)。

--metadata-configuration

向量索引元数据配置,JSON 字符串或 file:// 指定文件,最多 10 个键,如 '{"nonFilterableMetadataKeys":["k1"]}'。

使用示例

在向量桶 examplebucket 下创建一个 float32 类型、维度 512、欧氏距离的索引 index1。

ks3util vectors-api create-index --vector-bucket-name examplebucket --index-name index1 --data-type float32 --dimension 512 --distance-metric euclidean

创建索引并配置元数据过滤键。

ks3util vectors-api create-index --vector-bucket-name examplebucket --index-name index1 --data-type float32 --dimension 512 --distance-metric euclidean --metadata-configuration '{"nonFilterableMetadataKeys":["tag"]}'

按向量桶 KRN 创建索引。

ks3util vectors-api create-index --vector-bucket-krn krn:ksc:ks3vectors:beijing:uid:bucket/examplebucket --index-name index1 --data-type float32 --dimension 512 --distance-metric euclidean

上一篇:向量索引
下一篇:get-index
以上内容是否对您有帮助?
有帮助
没帮助