Using Filters
While vector search excels at finding semantically similar content, filters allow you to narrow results based on exact payload criteria. This combination of semantic search and filtering makes Airweave particularly powerful for finding specific information within large datasets.
Why Filters Matter
Consider searching for “payment processing issues” across your connected systems. Without filters, you might get results from three years ago, from test environments, or from unrelated payment systems. Filters let you specify exactly which subset of data to search within.
Filter Structure
Airweave uses Qdrant’s filtering system, which provides a flexible way to express complex conditions. Filters consist of conditions combined with logical operators.
Try these filter examples in our interactive API playground.
Basic Filter Anatomy
Logical Operators
Filters support three logical operators that can be combined to create complex queries:
Must (AND)
All conditions in the must
array must be satisfied. Think of this as an AND operation.
Should (OR)
At least one condition in the should
array must be satisfied. This creates an OR operation.
Must Not (NOT)
None of the conditions in the must_not
array can be satisfied. Use this to exclude results.
Common Airweave Fields
Understanding the available fields is crucial for effective filtering. Here are the most commonly used fields across Airweave data sources:
source_name
field
The data source identifier. Important: This field is case-sensitive.
Timestamps
Timestamps use ISO 8601 format. Use DatetimeRange
for date filtering:
Nested Payload
Nested fields can be accessed using dot notation:
Practical Examples
Filter by Source
Find all content from a specific data source:
Date Range Filtering
Find recent items within the last 30 days:
Complex Multi-Source Query
Find high-priority items from multiple support systems:
Handling Case Sensitivity
Since source_name
is case-sensitive, use MatchAny
to handle variations:
Advanced Filtering
Combining Conditions
Create sophisticated filters by nesting conditions:
Null and Empty Checks
Check for missing or empty fields:
Next Steps
- Explore search examples with real-world filtering scenarios
- Review the API reference for complete filter specifications
- Learn about search concepts for a comprehensive understanding