昇腾社区首页
中文
注册
开发者
下载

create_collection

功能描述

在向量数据库中创建指定collection并设置索引方式。

函数原型

def create_collection(x_dim,  params)

参数说明

参数名

数据类型

可选/必选

说明

x_dim

int

必选

向量长度,0 < x_dim ≤ 1024 * 1024,默认值为None。

params

dict

可选

索引类型的额外参数,默认为“None”。为None情况下会设置为空字典,参考milvus In-memory-Index。字典校验,字典中字符串长度不能超过1024,字典中包含的可迭代序列长度不能超过1024,字典长度不能超过1024,字典嵌套深度不能超过2层。

参数配置多一层类型"sparse"、"dense"用于指示对应是参数是给稠密或稀疏检索使用。配置示例如下:

{

"sparse": {},

"dense": {}

}