diff --git a/crates/index-scheduler/src/batch.rs b/crates/index-scheduler/src/batch.rs index e23d1c1bb..6255bf332 100644 --- a/crates/index-scheduler/src/batch.rs +++ b/crates/index-scheduler/src/batch.rs @@ -829,21 +829,18 @@ impl IndexScheduler { if status == Status::Enqueued { let content_file = self.file_store.get_update(content_file)?; - let reader = DocumentsBatchReader::from_reader(content_file) - .map_err(|e| Error::from_milli(e.into(), None))?; - - let (mut cursor, documents_batch_index) = - reader.into_cursor_and_fields_index(); - - while let Some(doc) = cursor - .next_document() - .map_err(|e| Error::from_milli(e.into(), None))? + for document in + serde_json::de::Deserializer::from_reader(content_file).into_iter() { - dump_content_file.push_document( - &obkv_to_object(doc, &documents_batch_index) - .map_err(|e| Error::from_milli(e, None))?, - )?; + let document = document.map_err(|e| { + Error::from_milli( + milli::InternalError::SerdeJson(e).into(), + None, + ) + })?; + dump_content_file.push_document(&document)?; } + dump_content_file.flush()?; } }