最近更新时间: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
纯净模式
