Searching
Filters
Search filters allow you to narrow down results based on specific criteria using logical operators and field conditions.
Understanding Filters
Filter Types
-
Logical Operators
AND
: All conditions must matchOR
: Any condition can matchNOR
: No conditions should match
-
Field Operators
eq
: Exact matchneq
: Not equalgt
: Greater thangte
: Greater than or equallt
: Less thanlte
: Less than or equalin
: Value in arraynin
: Value not in arrayexists
: Field existsregex
: Regular expression match
Filter Structure
Basic Filter
Complex Filter
Best Practices
Performance Optimization
- Use indexed fields for filtering
- Combine related conditions under single operators
- Order conditions from most to least selective
- Use appropriate operators for data types
Common Use Cases
-
Metadata Filtering
- Filter by author, date, status
- Filter by categories or tags
- Filter by custom metadata fields
-
Content Filtering
- Filter by content type
- Filter by content length
- Filter by content language
-
Quality Filtering
- Filter by confidence scores
- Filter by relevance thresholds
- Filter by feature quality metrics
Limitations
Technical Limitations
- Only indexed fields can be filtered
- Complex filters may impact performance
- Maximum of 20 conditions per operator
- Nested filters not supported
Performance Impact
- Each additional filter adds overhead
- Complex regex operations are expensive
- Large IN/NIN arrays affect performance
- Case-sensitive filtering requires more resources
Data Type Constraints
- Date fields must use ISO 8601 format
- Numeric comparisons require consistent types
- Boolean values must be true/false
- String comparisons are exact by default
Error Handling
Common Errors
- Invalid field names
- Unsupported operators
- Type mismatches
- Missing required values
Resolution Steps
- Verify field names are correct
- Check operator compatibility
- Validate value types
- Ensure all required fields are present
For implementation details and examples, see the Search API Reference.