Wire FilterBar query AST into logs/timeline queries (ticket 007)
Adds a filter evaluator in engine.rs that compiles a parsed FilterExpr against the current index once per query (regex compiled once, sequence/timestamp compared directly against IngestedLog fields, other metric comparisons resolved to a HashSet<u64> of matching sequences via a bucket scan) and evaluates it per log line with no further index access. Wires this into EngineQuery::Logs/Timeline via a new LogsParams::filter/TimelineParams::filter field, and adds EngineResponse::Error so a malformed filter string surfaces as a query-level error (mapped to 400 in api.rs). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
49e8590cf3
commit
86a1a40243
@@ -67,7 +67,11 @@ pub enum Number {
|
||||
}
|
||||
|
||||
impl Number {
|
||||
fn as_f64(&self) -> f64 {
|
||||
/// Widens to `f64` for cross-kind numeric comparisons (e.g. a filter
|
||||
/// query's `FilterValue::Number` against a declared metric's captured
|
||||
/// `Number`). `pub(crate)` rather than private since ticket 007's filter
|
||||
/// evaluator (in `engine.rs`) needs it and lives in a different module.
|
||||
pub(crate) fn as_f64(&self) -> f64 {
|
||||
match self {
|
||||
Number::Int(v) => *v as f64,
|
||||
Number::Float(v) => *v,
|
||||
|
||||
Reference in New Issue
Block a user