From f376c6a7287a952599cfe203e08f397edc672163 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 3 Mar 2021 10:48:16 +0100 Subject: [PATCH] Make sure we retrieve the docid word positions --- milli/src/update/index_documents/store.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/milli/src/update/index_documents/store.rs b/milli/src/update/index_documents/store.rs index 05974d55e..05767080a 100644 --- a/milli/src/update/index_documents/store.rs +++ b/milli/src/update/index_documents/store.rs @@ -274,13 +274,15 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { self.insert_words_pairs_proximities_docids(words_pair_proximities, document_id)?; // We store document_id associated with all the words the record contains. - for (word, _) in words_positions.drain() { - self.insert_word_docid(&word, document_id)?; + for (word, _) in words_positions.iter() { + self.insert_word_docid(word, document_id)?; } self.documents_writer.insert(document_id.to_be_bytes(), record)?; Self::write_docid_word_positions(&mut self.docid_word_positions_writer, document_id, words_positions)?; + words_positions.clear(); + // We store document_id associated with all the field id and values. for (field, values) in facet_values.drain() { for value in values {