diff --git a/src/indexer/merger.rs b/src/indexer/merger.rs index 93b11120b2..df15a925be 100644 --- a/src/indexer/merger.rs +++ b/src/indexer/merger.rs @@ -237,9 +237,14 @@ impl IndexMerger { for field in fields { fieldnorms_data.clear(); if let Some(doc_id_mapping) = doc_id_mapping { + let fieldnorms_readers: Vec = self + .readers + .iter() + .map(|reader| reader.get_fieldnorms_reader(field)) + .collect::>()?; for (doc_id, reader_with_ordinal) in doc_id_mapping { let fieldnorms_reader = - reader_with_ordinal.reader.get_fieldnorms_reader(field)?; + &fieldnorms_readers[reader_with_ordinal.ordinal as usize]; let fieldnorm_id = fieldnorms_reader.fieldnorm_id(*doc_id); fieldnorms_data.push(fieldnorm_id); }