Python
collection = client.create_collection(name='my_collection')const collection = await client.createCollection({ name: 'my_collection' });let collection = client.get_or_create_collection("my_collection", None).await?;{
"configuration_json": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"spann": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"merge_threshold": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"split_threshold": 1,
"write_nprobe": 1
}
},
"database": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"log_position": 123,
"name": "<string>",
"tenant": "<string>",
"version": 123,
"dimension": 123,
"metadata": {},
"schema": {
"defaults": {
"bool": {
"bool_inverted_index": {
"config": {},
"enabled": true
}
},
"float": {
"float_inverted_index": {
"config": {},
"enabled": true
}
},
"float_list": {
"vector_index": {
"config": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"batch_size": 1,
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"num_threads": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"source_key": "<string>",
"spann": {
"center_drift_threshold": 123,
"ef_construction": 1,
"ef_search": 1,
"initial_lambda": 123,
"max_neighbors": 1,
"merge_threshold": 1,
"nreplica_count": 1,
"num_centers_to_merge_to": 1,
"num_samples_kmeans": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"search_rng_epsilon": 123,
"search_rng_factor": 123,
"split_threshold": 1,
"write_nprobe": 1,
"write_rng_epsilon": 123,
"write_rng_factor": 123
}
},
"enabled": true
}
},
"int": {
"int_inverted_index": {
"config": {},
"enabled": true
}
},
"sparse_vector": {
"sparse_vector_index": {
"config": {
"bm25": true,
"embedding_function": {
"type": "legacy"
},
"source_key": "<string>"
},
"enabled": true
}
},
"string": {
"fts_index": {
"config": {},
"enabled": true
},
"string_inverted_index": {
"config": {},
"enabled": true
}
}
},
"keys": {},
"cmek": {}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Collection
Create collection
Creates a new collection in a database.
POST
/
api
/
v2
/
tenants
/
{tenant}
/
databases
/
{database}
/
collections
Python
collection = client.create_collection(name='my_collection')const collection = await client.createCollection({ name: 'my_collection' });let collection = client.get_or_create_collection("my_collection", None).await?;{
"configuration_json": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"spann": {
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"merge_threshold": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"split_threshold": 1,
"write_nprobe": 1
}
},
"database": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"log_position": 123,
"name": "<string>",
"tenant": "<string>",
"version": 123,
"dimension": 123,
"metadata": {},
"schema": {
"defaults": {
"bool": {
"bool_inverted_index": {
"config": {},
"enabled": true
}
},
"float": {
"float_inverted_index": {
"config": {},
"enabled": true
}
},
"float_list": {
"vector_index": {
"config": {
"embedding_function": {
"type": "legacy"
},
"hnsw": {
"batch_size": 1,
"ef_construction": 1,
"ef_search": 1,
"max_neighbors": 1,
"num_threads": 1,
"resize_factor": 123,
"sync_threshold": 1
},
"source_key": "<string>",
"spann": {
"center_drift_threshold": 123,
"ef_construction": 1,
"ef_search": 1,
"initial_lambda": 123,
"max_neighbors": 1,
"merge_threshold": 1,
"nreplica_count": 1,
"num_centers_to_merge_to": 1,
"num_samples_kmeans": 1,
"reassign_neighbor_count": 1,
"search_nprobe": 1,
"search_rng_epsilon": 123,
"search_rng_factor": 123,
"split_threshold": 1,
"write_nprobe": 1,
"write_rng_epsilon": 123,
"write_rng_factor": 123
}
},
"enabled": true
}
},
"int": {
"int_inverted_index": {
"config": {},
"enabled": true
}
},
"sparse_vector": {
"sparse_vector_index": {
"config": {
"bm25": true,
"embedding_function": {
"type": "legacy"
},
"source_key": "<string>"
},
"enabled": true
}
},
"string": {
"fts_index": {
"config": {},
"enabled": true
},
"string_inverted_index": {
"config": {},
"enabled": true
}
}
},
"keys": {},
"cmek": {}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
application/json
Collection creation payload
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schema representation for collection index configurations
This represents the server-side schema structure used for index management
Show child attributes
Show child attributes
Response
Collection created successfully
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schema representation for collection index configurations
This represents the server-side schema structure used for index management
Show child attributes
Show child attributes
Was this page helpful?
⌘I