create_collection

Function

Creates a specified collection in a vector database and sets an indexing mode.

Prototype

def create_collection(x_dim,  params)

Parameters

Parameter

Data Type

Required/Optional

Description

x_dim

Integer

Required

Vector length: 0 < x_dim ≤ 1024 × 1024. The default value is None.

params

Dict

Optional

Additional parameter of the index type. The default value is None. If the value is None, an empty dictionary is set. For details, see milvus In-memory-Index. For dictionary verification, the dictionary, its strings, and all iterable sequences must not exceed 1024 in length, and the number of nested dictionary layers cannot exceed 2.

Parameter configurations now include "sparse" and "dense" types to specify whether they apply to sparse or dense retrieval modes. A configuration example is as follows:

{

"sparse": {},

"dense": {}

}