aboutsummaryrefslogtreecommitdiff
path: root/import/src
diff options
context:
space:
mode:
Diffstat (limited to 'import/src')
-rw-r--r--import/src/db.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/import/src/db.rs b/import/src/db.rs
index 4c62681..49c2f0e 100644
--- a/import/src/db.rs
+++ b/import/src/db.rs
@@ -1,11 +1,11 @@
-use std::collections::HashMap;
-
-use anyhow::anyhow;
+use anyhow::{anyhow, Context};
use jellybase::database::{
- doc, DataAcid, ReadableTable, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
+ tantivy::{doc, DateTime},
+ DataAcid, ReadableTable, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
};
use jellycommon::{ExtendedNode, Node};
use log::info;
+use std::collections::HashMap;
use std::sync::RwLock;
pub(crate) trait ImportStorage: Sync {
@@ -150,9 +150,11 @@ impl ImportStorage for MemoryStorage<'_> {
self.db.node_index.id => node.public.id.unwrap_or_default(),
self.db.node_index.title => node.public.title.unwrap_or_default(),
self.db.node_index.description => node.public.description.unwrap_or_default(),
- self.db.node_index.releasedate => node.public.release_date.unwrap_or_default(),
+ self.db.node_index.releasedate => DateTime::from_timestamp_millis(node.public.release_date.unwrap_or_default()),
self.db.node_index.f_index => node.public.index.unwrap_or_default() as u64,
- ))?;
+ ))
+ .context("inserting document")?;
+
Ok(())
}