slackhq / astra

Astra is a structured log search and analytics engine developed by Slack and Salesforce
https://slackhq.github.io/astra/
MIT License
213 stars 30 forks source link

Fix query date parsing in the query nodes #1081

Closed kyle-sammons closed 1 month ago

kyle-sammons commented 1 month ago

Summary

Currently we're parsing the query into a QueryBuilder, then transforming that into a Lucene Query, and then using the Query::visit function to extract the start/end time of the query. While this works well enough for certain queries, it requires us to have the full schema in the Query Node ahead of time, and fails any queries that need said schema. Instead, we should use the QueryBuider::visit functions to recurse through the tree and extract the start/end times as that's far simpler, faster, and doesn't require a full schema

Requirements