Skip to content

Collections and indexes

Collection declarations make vector topology reviewable alongside the queries that use it. Define vectors first, add payload indexes for fields you filter or order by, and add shard keys only when Qdrant routing is part of the design.

Vector names are application-defined. dense, sparse, and colbert are useful conventions, but vector configuration determines the actual role. A dense definition is name VECTOR(size, distance) with distance COSINE, DOT, EUCLID, or MANHATTAN; a sparse definition is name SPARSE with optional WITH SPARSE (...) / WITH INDEX (...) config.

QQLDense, sparse, and multivector topologyTry in playground
CREATE COLLECTION research (
dense VECTOR(384, COSINE),
sparse SPARSE,
colbert VECTOR(128, COSINE)
WITH MULTIVECTOR (comparator = 'max_sim')
WITH HNSW (m = 0)
)
WITH HNSW (
m = 16,
ef_construct = 100
);
RequirementSchema choice
Semantic retrievalA dense VECTOR(size, distance)
Lexical or sparse retrievalA named SPARSE vector
Late interactionA multivector with a comparator
Hybrid retrievalBoth a dense and sparse vector

A CREATE COLLECTION can name a mode instead of (or alongside) explicit vector definitions. Modes infer a conventional topology:

ModeResulting topology
(no mode)Bare dense topology without a model hint
USING DENSE MODEL 'name'Dense topology with dimension inference from the model
USING HYBRIDConventional hybrid dense + sparse topology
HYBRID RERANKConventional rerank topology
HYBRID DENSE VECTOR semantic_v2 SPARSE VECTOR lexical_v2Hybrid topology with arbitrary role names

Explicit dense and sparse vector definitions may coexist with the collection blocks below. Dense size must be positive.

Config blocks attach to the collection with WITH <BLOCK> (...) and to individual dense vectors (WITH HNSW, WITH VECTOR, WITH QUANTIZATION, WITH MULTIVECTOR). Keys are ASCII case-insensitive and unique.

BlockAccepted keys
HNSWm, ef_construct, full_scan_threshold, max_indexing_threads, on_disk, payload_m, inline_storage
VECTORon_disk
OPTIMIZERSdeleted_threshold, vacuum_min_vector_number, default_segment_number, max_segment_size, memmap_threshold, indexing_threshold, flush_interval_sec, max_optimization_threads, prevent_unoptimized
PARAMSreplication_factor, write_consistency_factor, on_disk_payload, shard_number, sharding_method, shard_keys
QUANTIZATIONtype (scalar/binary/product/turbo), disabled, always_ram, quantile, bits, compression, encoding, query_encoding
MULTIVECTORcomparator (max_sim)
sparse INDEX/SPARSEmodifier, full_scan_threshold, on_disk, datatype

read_fan_out_factor and read_fan_out_delay_ms are ALTER-only PARAMS keys, and QUANTIZATION (disabled = true) is an ALTER form. ALTER COLLECTION applies any of the HNSW, VECTOR, OPTIMIZERS, PARAMS, or QUANTIZATION blocks to an existing collection.

QQLReplication, quantization, and alterTry in playground
CREATE COLLECTION sec10k (
dense VECTOR(768, COSINE),
sparse SPARSE
) WITH HNSW (m = 16, ef_construct = 100)
WITH PARAMS (
replication_factor = 2,
shard_number = 8,
sharding_method = 'custom',
shard_keys = ['honeywell', 'ge']
);
ALTER COLLECTION sec10k WITH QUANTIZATION (type = 'scalar');

Create payload indexes for fields used frequently in filters, tenant predicates, or ordering. Index design is a Qdrant performance decision, not a requirement for every payload field. The index TYPE is keyword, integer, float, geo, text, bool, datetime, or uuid.

QQLTenant and text payload indexesTry in playground
CREATE INDEX ON COLLECTION research
FOR tenant_id
TYPE keyword
WITH (
is_tenant = true,
on_disk = true
);
CREATE INDEX ON COLLECTION research
FOR content
TYPE text
WITH (
tokenizer = 'multilingual',
lowercase = true,
phrase_matching = true
);

CREATE INDEX ... WITH (...) accepts the following options:

OptionType
is_tenant, on_disk, enable_hnswboolean
lowercase, ascii_folding, phrase_matching, lookup, range, is_principalboolean
min_token_len, max_token_lennon-negative integer
tokenizerstring
stemmerstring
stopwordsstring list

DROP INDEX ON COLLECTION research FOR field removes an index.

SHOW has exactly three forms — there is no SHOW INDEXES.

StatementReturns
SHOW COLLECTIONS;All collection names
SHOW COLLECTION name;A single collection's configuration
SHOW SHARD KEYS ON COLLECTION name;The custom shard keys of a collection

Shard-key DDL creates and manages routing partitions. It is separate from the tenant predicate your service must enforce.

QQLManage a custom shard keyTry in playground
CREATE SHARD KEY 'acme'
ON COLLECTION research
WITH (shards_number = 2);
SHOW SHARD KEYS
ON COLLECTION research;
DROP SHARD KEY 'acme'
ON COLLECTION research;

Next: Data operations and Multitenancy.