diff --git a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs index e091df6b8..2d51fcc1a 100644 --- a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs +++ b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs @@ -13,6 +13,8 @@ use crate::{ absolute_from_relative_position, FieldId, Result, MAX_POSITION_PER_ATTRIBUTE, MAX_WORD_LENGTH, }; +pub type ScriptLanguageDocidsMap = HashMap<(Script, Language), RoaringBitmap>; + /// Extracts the word and positions where this word appear and /// prefixes it by the document id. /// @@ -25,7 +27,7 @@ pub fn extract_docid_word_positions( searchable_fields: &Option>, stop_words: Option<&fst::Set<&[u8]>>, max_positions_per_attributes: Option, -) -> Result<(RoaringBitmap, grenad::Reader, HashMap<(Script, Language), RoaringBitmap>)> { +) -> Result<(RoaringBitmap, grenad::Reader, ScriptLanguageDocidsMap)> { let max_positions_per_attributes = max_positions_per_attributes .map_or(MAX_POSITION_PER_ATTRIBUTE, |max| max.min(MAX_POSITION_PER_ATTRIBUTE)); let max_memory = indexer.max_memory_by_thread(); diff --git a/milli/src/update/index_documents/extract/mod.rs b/milli/src/update/index_documents/extract/mod.rs index f38bdd497..c0f07cf79 100644 --- a/milli/src/update/index_documents/extract/mod.rs +++ b/milli/src/update/index_documents/extract/mod.rs @@ -260,7 +260,7 @@ fn send_and_extract_flattened_documents_data( let (documents_ids, docid_word_positions_chunk, script_language_pair) = extract_docid_word_positions( flattened_documents_chunk.clone(), - indexer.clone(), + indexer, searchable_fields, stop_words.as_ref(), max_positions_per_attributes, diff --git a/milli/src/update/index_documents/typed_chunk.rs b/milli/src/update/index_documents/typed_chunk.rs index 35f09c051..b9b11cfa8 100644 --- a/milli/src/update/index_documents/typed_chunk.rs +++ b/milli/src/update/index_documents/typed_chunk.rs @@ -224,8 +224,7 @@ pub(crate) fn write_typed_chunk_into_index( let mut new_value_buffer = Vec::new(); serialize_roaring_bitmap(&value, &mut new_value_buffer)?; merge_roaring_bitmaps(&new_value_buffer, &db_value_buffer, &mut buffer)?; - let merged_db_values = RoaringBitmap::deserialize_from(&buffer[..])?; - merged_db_values + RoaringBitmap::deserialize_from(&buffer[..])? } None => value, };