Metadata filtering
Metadata filtering limits a search to items whose stored attributes, such as date, author, language or access group, match given conditions, alongside or before ranking them by vector similarity.
Also called: filtered vector search, payload filtering
By Divya Sharma · Checked Nov 15, 2026 · How we review
An embedding captures what a passage is about, not facts like "published after March" or "visible to the finance team". Metadata filtering covers those. Each vector in a vector database is stored with fields (Qdrant calls them a payload), and a query can say "nearest neighbors, but only where tenant is acme and the year is this one".
Why it matters
Filters make results correct, not just similar. A support bot should only quote the current version of a policy. A multi-tenant app must never return another customer's documents. Filtering on access fields at query time is one layer of that protection, though it should not be the only one.
How it is done
Pre-filtering applies the condition first, then searches only the matching vectors. Post-filtering searches first, then drops items that fail, which can leave you with too few results. Modern vector databases mostly filter during the index walk. Creating an index on filtered fields keeps this fast.
Limits
Very selective filters can hurt recall in graph indexes like HNSW, since the walk has fewer valid nodes to step through. Metadata is only as good as the document parsing and ingestion that produced it, so missing dates or wrong owners give wrong results. Test filtered queries separately when you measure retrieval metrics.
Related terms
- Vector database
- A vector database stores embeddings alongside their source records and finds the stored vectors closest to a query vector, usually with an approximate index so search stays fast across millions of items.
- HNSW
- HNSW (hierarchical navigable small world) is a graph-based index for approximate nearest neighbor search. It links vectors to their neighbors across several layers, so a search can hop quickly toward the closest matches.
- Hybrid search
- Hybrid search runs a keyword search and a vector search on the same query and merges the two ranked lists, so results can match on exact words as well as on meaning.
- Document parsing
- Document parsing converts files such as PDFs, scans, slides and spreadsheets into structured text that software can use, keeping headings, reading order, tables and images instead of a flat stream of characters.
- Retrieval metrics (recall@k, nDCG, MRR)
- Retrieval metrics score how well a search system returns relevant documents. Recall@k checks how many relevant items appear in the top k, nDCG rewards ranking them high, and MRR measures how early the first correct one appears.