Database / Qdrant Vector DB Interview questions
How do you create a collection in Qdrant?
Creating a collection means calling create_collection with a name and a vector configuration specifying at minimum the vector size (dimensionality) and the distance metric to use for similarity comparisons.
from qdrant_client import QdrantClient, models client = QdrantClient(url="http://localhost:6333") client.create_collection( collection_name="documents", vectors_config=models.VectorParams( size=768, distance=models.Distance.COSINE, ), )
Beyond the basic vector configuration, collection creation also accepts optional settings for sharding (shard_number), replication (replication_factor), on-disk versus in-memory storage, HNSW index parameters, and quantization configuration, letting a collection be tuned for its expected scale and access pattern right from the start.
For a collection that needs multiple distinct embeddings per point — a text vector and an image vector, for instance — vectors_config accepts a dictionary of named vector configurations instead of a single one, so each named vector can even have its own size and distance metric independently.
More Related questions...