mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-24 20:27:32 +01:00
Create update files in new format
This commit is contained in:
parent
b9d92c481b
commit
50fca8fc70
@ -4,7 +4,6 @@ use std::sync::atomic::Ordering;
|
|||||||
|
|
||||||
use dump::IndexMetadata;
|
use dump::IndexMetadata;
|
||||||
use meilisearch_types::milli::constants::RESERVED_VECTORS_FIELD_NAME;
|
use meilisearch_types::milli::constants::RESERVED_VECTORS_FIELD_NAME;
|
||||||
use meilisearch_types::milli::documents::{obkv_to_object, DocumentsBatchReader};
|
|
||||||
use meilisearch_types::milli::progress::Progress;
|
use meilisearch_types::milli::progress::Progress;
|
||||||
use meilisearch_types::milli::vector::parsed_vectors::{ExplicitVectors, VectorOrArrayOfVectors};
|
use meilisearch_types::milli::vector::parsed_vectors::{ExplicitVectors, VectorOrArrayOfVectors};
|
||||||
use meilisearch_types::milli::{self};
|
use meilisearch_types::milli::{self};
|
||||||
@ -89,19 +88,15 @@ impl IndexScheduler {
|
|||||||
if status == Status::Enqueued {
|
if status == Status::Enqueued {
|
||||||
let content_file = self.queue.file_store.get_update(content_file)?;
|
let content_file = self.queue.file_store.get_update(content_file)?;
|
||||||
|
|
||||||
let reader = DocumentsBatchReader::from_reader(content_file)
|
for document in
|
||||||
.map_err(|e| Error::from_milli(e.into(), None))?;
|
serde_json::de::Deserializer::from_reader(content_file).into_iter()
|
||||||
|
|
||||||
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))?
|
|
||||||
{
|
{
|
||||||
dump_content_file.push_document(
|
let document = document.map_err(|e| {
|
||||||
&obkv_to_object(doc, &documents_batch_index)
|
Error::from_milli(milli::InternalError::SerdeJson(e).into(), None)
|
||||||
.map_err(|e| Error::from_milli(e, None))?,
|
})?;
|
||||||
)?;
|
dump_content_file.push_document(&document)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
dump_content_file.flush()?;
|
dump_content_file.flush()?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user