Filtered semantic search combines vector similarity with metadata conditions. Results must be both semantically similar to your query and match your filter criteria. Use filtered search to narrow results by category, topic, date range, or other metadata attributes. VectorAI DB evaluates filters during search (pre-filtering), which is more efficient than filtering results after retrieval. Before running these examples, make sure you have a VectorAI DB instance running atDocumentation Index
Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
Use this file to discover all available pages before exploring further.
localhost:6574 and the relevant SDK installed. For setup instructions, see Docker installation.
Keyword filter
Filter results by a specific keyword field value, such as topic or category:topic field to equal "ml". In Python, use FilterBuilder with .must() to construct the condition. In JavaScript, use new Field('topic').eq('ml') directly. Only documents matching this condition are considered during vector similarity search.
Range filter
Filter results by a numeric range, such as documents from a specific year onward:gte operator on the year field restricts results to documents from 2023 onward. VectorAI DB evaluates this condition during search, so only qualifying documents are compared by vector similarity.
Each result includes these fields:
id: The unique identifier of the matching documentscore: Similarity score for documents that passed the filterpayload: Metadata object containing the filtered attributes