You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Main entry point for extracting relevant information from the parsed query pattern. This function would contain the core logic for traversing the AST and applying rules to determine the target field, predicates, group by specifications, and aggregation type.
10
-
let search_request = parse_query_to_ast(query)?;
9
+
// Main entry point for extracting relevant information from the parsed query pattern.
10
+
let search_request = serde_json::from_str(query).ok()?;
// Traverse the aggregations in the AST and extracting relevant information. Extract the first valid aggregation type found, along with any associated group by specifications.
Some(GroupBySpec::Filters(_)) => {returnNone;}// We don't support filter-based group by in ES DSL for now, so return None to indicate unsupported query pattern.
111
+
Some(GroupBySpec::Filters(_)) => {
112
+
returnNone;
113
+
}// We don't support filter-based group by in ES DSL for now, so return None to indicate unsupported query pattern.
.first().clone();// For now, we only look at the first predicate for time range information. We can extend this to support multiple predicates and more complex logic in the future.
156
+
let predicate = query_info.predicates.first();// For now, we only look at the first predicate for time range information. We can extend this to support multiple predicates and more complex logic in the future.
// If we have a range predicate, we can try to extract time range information from it.
159
165
// For now, we assume that any range predicate applies to the timestamp field, but we could add more complex logic here to determine which field is the timestamp field.
160
-
debug!("Found range predicate in query, attempting to extract time range information");
0 commit comments