refactor: update construct_query to use 'timestamp' instead of '@timestamp' for sorting
taylorwalton committed
Dec 4, 2025 at 13:31 UTC
82e4ce50c262c3261904077092ccacb057c0e150
1 file changed
+1
-1
backend/app/incidents/services/alert_collection.py
+1
-1
@@ -37,7 +37,7 @@ async def construct_query():
37
"""
38
Constructs the query to find alerts where `fields.COPILOT_ALERT_ID` is NONE.
39
"""
40
- return {"query": {"bool": {"must": [{"term": {"fields.COPILOT_ALERT_ID": "NONE"}}]}}, "sort": [{"@timestamp": {"order": "asc"}}]}
40
+ return {"query": {"bool": {"must": [{"term": {"fields.COPILOT_ALERT_ID": "NONE"}}]}}, "sort": [{"timestamp": {"order": "asc"}}]}
41
42
43
async def fetch_alerts_for_index(es_client, index, query):