From 1cadab9ad8d87a3cf3716fd6359a04c379f63c60 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 16 Jan 2025 16:55:04 +0100 Subject: [PATCH] Also fix dump import from meilitool --- crates/meilitool/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/meilitool/src/main.rs b/crates/meilitool/src/main.rs index 44eb4960e..053e83b96 100644 --- a/crates/meilitool/src/main.rs +++ b/crates/meilitool/src/main.rs @@ -254,18 +254,15 @@ fn export_a_dump( if status == Status::Enqueued { let content_file = file_store.get_update(content_file_uuid)?; - let reader = - DocumentsBatchReader::from_reader(content_file).with_context(|| { + for document in + serde_json::de::Deserializer::from_reader(content_file).into_iter() + { + let document = document.with_context(|| { format!("While reading content file {:?}", content_file_uuid) })?; - - let (mut cursor, documents_batch_index) = reader.into_cursor_and_fields_index(); - while let Some(doc) = cursor.next_document().with_context(|| { - format!("While iterating on content file {:?}", content_file_uuid) - })? { - dump_content_file - .push_document(&obkv_to_object(doc, &documents_batch_index)?)?; + dump_content_file.push_document(&document)?; } + dump_content_file.flush()?; count += 1; }