From df176aaf01b61cbe703e0bc77f35f4df69d5e957 Mon Sep 17 00:00:00 2001 From: amab8901 Date: Wed, 21 Dec 2022 15:16:31 +0100 Subject: [PATCH] Insert dump_reader.date() into create_raw_index(_) argument --- meilisearch/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meilisearch/src/lib.rs b/meilisearch/src/lib.rs index 1dc40ac76..83631e5b2 100644 --- a/meilisearch/src/lib.rs +++ b/meilisearch/src/lib.rs @@ -289,8 +289,13 @@ fn import_dump( let mut index_reader = index_reader?; let metadata = index_reader.metadata(); log::info!("Importing index `{}`.", metadata.uid); - //let date = Some((time::OffsetDateTime::now_utc(), time::OffsetDateTime::now_utc())); - let date = dump_reader.date(); + let date; + if let Some(dump_reader_date) = dump_reader.date() { + date = Some((dump_reader_date, dump_reader_date)); + } else { + date = Some((time::OffsetDateTime::now_utc(), time::OffsetDateTime::now_utc())); + } + let index = index_scheduler.create_raw_index(&metadata.uid, date)?; let mut wtxn = index.write_txn()?;