diff --git a/milli/src/update/new/extract/searchable/tokenize_document.rs b/milli/src/update/new/extract/searchable/tokenize_document.rs index b8fd24f1b..5428907f8 100644 --- a/milli/src/update/new/extract/searchable/tokenize_document.rs +++ b/milli/src/update/new/extract/searchable/tokenize_document.rs @@ -171,12 +171,12 @@ mod test { use bumpalo::Bump; use charabia::TokenizerBuilder; use meili_snap::snapshot; - use raw_collections::RawMap; use serde_json::json; use serde_json::value::RawValue; use super::*; + use crate::update::new::document::{DocumentFromVersions, Versions}; use crate::FieldsIdsMap; #[test] @@ -222,7 +222,8 @@ mod test { let bump = Bump::new(); let document: &RawValue = serde_json::from_str(&document).unwrap(); let document = RawMap::from_raw_value(document, &bump).unwrap(); - let document = document.into_bump_slice(); + + let document = DocumentFromVersions::new(Versions::single(document)); document_tokenizer .tokenize_document( diff --git a/milli/src/update/new/indexer/partial_dump.rs b/milli/src/update/new/indexer/partial_dump.rs index 470dbc9d5..60cb627e9 100644 --- a/milli/src/update/new/indexer/partial_dump.rs +++ b/milli/src/update/new/indexer/partial_dump.rs @@ -1,15 +1,12 @@ use std::ops::DerefMut; use rayon::iter::IndexedParallelIterator; -use serde::Deserializer; use serde_json::value::RawValue; -use super::de::FieldAndDocidExtractor; use super::document_changes::{DocumentChangeContext, DocumentChanges, MostlySend, RefCellExt}; -use crate::documents::{DocumentIdExtractionError, PrimaryKey}; +use crate::documents::PrimaryKey; use crate::update::concurrent_available_ids::ConcurrentAvailableIds; -use crate::update::new::document::DocumentFromVersions; -use crate::update::new::document_change::Versions; +use crate::update::new::document::{DocumentFromVersions, Versions}; use crate::update::new::{DocumentChange, Insertion}; use crate::{Error, InternalError, Result, UserError}; @@ -79,8 +76,7 @@ where let document = raw_collections::RawMap::from_raw_value(document, doc_alloc) .map_err(InternalError::SerdeJson)?; - let document = document.into_bump_slice(); - let document = DocumentFromVersions::new(Versions::Single(document)); + let document = DocumentFromVersions::new(Versions::single(document)); let insertion = Insertion::create(docid, external_document_id, document); Ok(Some(DocumentChange::Insertion(insertion))) diff --git a/milli/src/update/new/indexer/update_by_function.rs b/milli/src/update/new/indexer/update_by_function.rs index 4c65edcc3..cff0e02fc 100644 --- a/milli/src/update/new/indexer/update_by_function.rs +++ b/milli/src/update/new/indexer/update_by_function.rs @@ -9,8 +9,7 @@ use super::DocumentChanges; use crate::documents::Error::InvalidDocumentFormat; use crate::documents::PrimaryKey; use crate::error::{FieldIdMapMissingEntry, InternalError}; -use crate::update::new::document::DocumentFromVersions; -use crate::update::new::document_change::Versions; +use crate::update::new::document::{DocumentFromVersions, Versions}; use crate::update::new::{Deletion, DocumentChange, KvReaderFieldId, Update}; use crate::{all_obkv_to_json, Error, FieldsIdsMap, Object, Result, UserError}; @@ -161,9 +160,8 @@ impl<'index> DocumentChanges<'index> for UpdateByFunctionChanges<'index> { } else { let raw_new_doc = RawMap::from_raw_value(raw_new_doc, doc_alloc) .map_err(InternalError::SerdeJson)?; - let new_doc_version = DocumentFromVersions::new(Versions::Single( - raw_new_doc.into_bump_slice(), - )); + let new_doc_version = + DocumentFromVersions::new(Versions::single(raw_new_doc)); Ok(Some(DocumentChange::Update(Update::create( docid, new_document_id,