The WHERE clause filters results in QUERY, SCROLL, UPDATE, and DELETE statements. For the complete operator reference (comparison, range, set membership, null checks, text matching, logical operators), see the Filter Reference.
Complex Filter Example
Section titled “Complex Filter Example”QUERY 'incident response' FROM runbooks LIMIT 10 WHERE ( (severity >= 3 AND status = 'open') OR (severity >= 5 AND status = 'acknowledged') ) AND assigned_team IS NOT NULL AND tags MATCH ANY 'kubernetes' 'docker' 'container' AND created_at BETWEEN '2024-01-01' AND '2025-12-31' AND NOT (category = 'deprecated')Per-Prefetch Filters
Section titled “Per-Prefetch Filters”Apply filters to individual CTE prefetch references at the DAG level:
WITH dense AS (QUERY 'search' USING dense LIMIT 200), sparse AS (QUERY 'search' USING sparse LIMIT 300)QUERY 'search' FROM docs LIMIT 10 PREFETCH ( dense WHERE category = 'tech' SCORE THRESHOLD 0.6, sparse WHERE priority = 'high' SCORE THRESHOLD 0.3 ) FUSION RRFPayload Indexes
Section titled “Payload Indexes”Always create indexes before filtering. Without an index, Qdrant performs a full collection scan.
CREATE INDEX ON docs FOR status TYPE keywordCREATE INDEX ON docs FOR year TYPE integerCREATE INDEX ON docs FOR score TYPE floatCREATE INDEX ON docs FOR published TYPE boolCREATE INDEX ON docs FOR doc_id TYPE uuidCREATE INDEX ON docs FOR created_at TYPE datetimeCREATE INDEX ON docs FOR location TYPE geoCREATE INDEX ON docs FOR content TYPE text WITH ( tokenizer = 'word', min_token_len = 2, max_token_len = 20, lowercase = true, phrase_matching = true, stopwords = ['en'])
-- Tenant isolationCREATE INDEX ON docs FOR org_id TYPE keyword WITH (is_tenant = true)