Metadata Filtering
Filter search results by metadata attributes using comparison and logical operators.Operators Reference
| Operator | Description | Example |
|---|---|---|
$eq | Equals (default) | {"status": "active"} |
$ne | Not equals | {"status": {"$ne": "archived"}} |
$gt | Greater than | {"score": {"$gt": 80}} |
$gte | Greater than or equal | {"priority": {"$gte": 7}} |
$lt | Less than | {"age": {"$lt": 30}} |
$lte | Less than or equal | {"count": {"$lte": 100}} |
$in | Value in list | {"status": {"$in": ["a", "b"]}} |
$nin | Not in list | {"status": {"$nin": ["x", "y"]}} |
$like | Pattern match (case-sensitive) | {"title": {"$like": "Important%"}} |
$ilike | Pattern match (case-insensitive) | {"email": {"$ilike": "%@company.com"}} |
$overlap | Array has any | {"tags": {"$overlap": ["urgent", "important"]}} |
$contains | Array has all | {"skills": {"$contains": ["python", "ml"]}} |
$and | All conditions match | {"$and": [{...}, {...}]} |
$or | Any condition matches | {"$or": [{...}, {...}]} |
Search responses can optionally include metadata via
search_settings.include_metadata. When included, Nebula returns a whitelisted subset (e.g., title, source, url, doc_type, mime_type, filename, page) to keep results compact.Examples
Common Patterns
Date Ranges
Multi-Status
Nested Properties
Best Practices
- Use proper data types: Store numbers as numbers, booleans as booleans
- Start simple: Begin with basic equality, add complexity as needed
- Use appropriate array operators:
$overlapfor “any of”,$containsfor “all of”
Next Steps
- Search Guide - Semantic search strategies
- Memory Operations - Core CRUD operations