Filtering

Filtering in Vector Search narrows results by metadata (e.g. source, date, document type) so you get the most relevant smart bites for RAG and grounded answers. Combined with semantic retrieval, filters reduce noise and keep answers scoped to the right documents.

What you can filter on

  • Source — Document ID, connector, or storage path. Use to restrict to a specific repo, folder, or data source.
  • Date — Extraction date, document date, or effective date. Use for “only documents from 2024” or “current policy only.”
  • Document type — Contract, invoice, policy, etc. Use when one collection holds multiple types and you want to scope by type.
  • Custom metadata — Any field you index in the collection (e.g. department, region, confidentiality). See Collections.

Filters are applied at query time. Only smart bites that match the filter criteria are considered for similarity ranking.

How to apply filters

  • API — Pass filter criteria in the search request (e.g. metadata.document_type = "contract", metadata.effective_date >= "2024-01-01"). See API reference for the exact syntax.
  • UI — If the Platform exposes search, use the provided filter controls for indexed metadata fields.

Filter syntax and supported operators (equality, range, in-list) depend on the product; see the reference docs for your deployment.

Best practices

  • Index only what you filter on — Ensure metadata you need for filtering is stored and indexed when building the collection. See Collections.
  • Combine with semantic search — Filters prune the set; semantic similarity ranks within that set. Use both for best relevance.
  • Source lineage — Preserve document and run IDs in metadata so grounded answers can cite the exact source.

Common pitfalls

  • Filtering on unindexed fields — Filters apply only to indexed metadata. Add fields to the collection index configuration.
  • Over-filtering — Too strict filters can return no results. Start with fewer filters and tighten as needed.
  • Wrong field type — Date filters require date metadata; use the correct type when indexing and querying.

Next steps