Give the settings diff to the write_typed_chunk_into_index function

This commit is contained in:
Clément Renault 2024-05-29 14:50:00 +02:00 committed by ManyTheFish
parent 1ab03c4ede
commit fad4675abe
2 changed files with 6 additions and 3 deletions

View File

@ -369,6 +369,7 @@ where
// Run extraction pipeline in parallel.
pool.install(|| {
let settings_diff_cloned = settings_diff.clone();
rayon::spawn(move || {
let child_span = tracing::trace_span!(target: "indexing::details", parent: &current_span, "extract_and_send_grenad_chunks");
let _enter = child_span.enter();
@ -398,7 +399,7 @@ where
pool_params,
lmdb_writer_sx.clone(),
primary_key_id,
settings_diff.clone(),
settings_diff_cloned,
max_positions_per_attributes,
)
});
@ -425,7 +426,7 @@ where
Err(status) => {
if let Some(typed_chunks) = chunk_accumulator.pop_longest() {
let (docids, is_merged_database) =
write_typed_chunk_into_index(typed_chunks, self.index, self.wtxn)?;
write_typed_chunk_into_index(self.wtxn, self.index, &settings_diff, typed_chunks)?;
if !docids.is_empty() {
final_documents_ids |= docids;
let documents_seen_count = final_documents_ids.len();

View File

@ -123,8 +123,10 @@ impl TypedChunk {
#[tracing::instrument(level = "trace", skip_all, target = "indexing::write_db")]
pub(crate) fn write_typed_chunk_into_index(
typed_chunks: Vec<TypedChunk>,
index: &Index,
wtxn: &mut RwTxn,
index: &Index,
settings_diff: &InnerIndexSettingsDiff,
typed_chunks: Vec<TypedChunk>,
) -> Result<(RoaringBitmap, bool)> {
let mut is_merged_database = false;
match typed_chunks[0] {