Metadata Filtering for Hybrid Search
Combine vector similarity with structured filters (date, author, tag) to get precise, contextual retrieval.
Why Filtering?
Pure vector search returns the K most similar chunks — even if they belong to the wrong tenant, wrong language, or wrong document.
Metadata filters scope the search to relevant subsets, giving you precision AND recall.
Storing Metadata
Attach a dict of metadata to every chunk on ingestion:
metadata = {
'tenant_id': 'acme',
'language': 'en',
'source': 'help-docs',
'updated_at': '2024-08-12',
'tags': ['shipping', 'returns']
}All lessons in this course
- Pinecone, Weaviate, Qdrant: Comparison
- Metadata Filtering for Hybrid Search
- Updating and Deleting Vectors
- Choosing Distance Metrics (cosine, L2, dot)