Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(search): update sort script (#2267)

gbirmana76fe8741da4
diff --git a/rust/cloud-storage/opensearch_client/src/search/builder.rs b/rust/cloud-storage/opensearch_client/src/search/builder.rs
index 32d78c6865..51d8768da9 100644
--- a/rust/cloud-storage/opensearch_client/src/search/builder.rs
+++ b/rust/cloud-storage/opensearch_client/src/search/builder.rs
@@ -52,9 +52,9 @@ pub(crate) fn updated_at_sort<'a>() -> Vec<SortType<'a>> {
SortType::ScriptSort(ScriptSort::new(
Script::new(
r#"if (doc.containsKey('sent_at_seconds') && doc['sent_at_seconds'].size() > 0) {
- return doc['sent_at_seconds'].value.millis;
+ return doc['sent_at_seconds'].value.toInstant().toEpochMilli();
} else if (doc.containsKey('updated_at_seconds') && doc['updated_at_seconds'].size() > 0) {
- return doc['updated_at_seconds'].value.millis;
+ return doc['updated_at_seconds'].value.toInstant().toEpochMilli();
} else {
return 0L;
}"#,