createCollection

abstract suspend fun createCollection(name: String, configure: CreateCollectionBuilder.() -> Unit)

Create a collection.

qdrant.createCollection("docs") {
vector { size = 768; distance = Distance.COSINE }
onDiskPayload = true
}

Creating a collection that already exists is rejected by the server, not treated as a no-op.

Parameters

name

the collection name.

configure

builds the collection settings (vectors, HNSW, on-disk payload, ...).

Throws

if the collection already exists or the settings are invalid.

if the API key is missing or wrong.

if the request exceeds the configured timeout.

on a connection failure or server error.