Advanced Filtering: Database-style Query Operations
Problem Statement
Currently, Thoth supports text-based search and JSONPath queries, but lacks database-style filtering operations. Users working with numerical data, timestamps, or need to filter records based on comparison operators (>, <, >=, <=, !=) have to manually scan results.
Use Cases:
- DevOps: Filter logs where
response_time > 500 or status_code != 200
- Analytics: Find records where
price < 100 and stock > 0
- Monitoring: Identify events where
timestamp > "2024-01-01" and error_level = "critical"
- API testing: Filter responses where
user.age >= 18 or items.length < 10
Proposed Solution
Add a filtering query language that supports comparison operators, logical operators, and type-aware comparisons.
Syntax Examples
price > 100
age >= 18 AND country = "US"
status != "deleted" AND (priority = "high" OR urgent = true)
items.length >= 3
deleted_at = null
Implementation Approach
- Query parser using recursive descent or nom crate
- Type-aware evaluation (numbers, strings, booleans, null)
- Parallel evaluation with Rayon
- Integration with existing search UI
Acceptance Criteria
- Parse comparison operators (>, <, >=, <=, !=, =)
- Support logical operators (AND, OR) with proper precedence
- Handle parentheses for grouping
- Type-aware comparisons
- Field existence checks
- Maintain search performance
- Tests and documentation
Advanced Filtering: Database-style Query Operations
Problem Statement
Currently, Thoth supports text-based search and JSONPath queries, but lacks database-style filtering operations. Users working with numerical data, timestamps, or need to filter records based on comparison operators (>, <, >=, <=, !=) have to manually scan results.
Use Cases:
response_time > 500orstatus_code != 200price < 100andstock > 0timestamp > "2024-01-01"anderror_level = "critical"user.age >= 18oritems.length < 10Proposed Solution
Add a filtering query language that supports comparison operators, logical operators, and type-aware comparisons.
Syntax Examples
Implementation Approach
Acceptance Criteria