From 4b0da0ff243e374f2ad347235c2733e5ec530ae3 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 30 Sep 2024 11:34:50 +0200 Subject: [PATCH] Fix inversion of field_id and position --- .../update/new/extract/searchable/extract_word_docids.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/milli/src/update/new/extract/searchable/extract_word_docids.rs b/milli/src/update/new/extract/searchable/extract_word_docids.rs index c5c3cd2a2..fb79de7b9 100644 --- a/milli/src/update/new/extract/searchable/extract_word_docids.rs +++ b/milli/src/update/new/extract/searchable/extract_word_docids.rs @@ -296,13 +296,13 @@ impl WordDocidsCachedSorters { buffer.clear(); buffer.extend_from_slice(word.as_bytes()); buffer.push(0); - buffer.extend_from_slice(&position.to_be_bytes()); + buffer.extend_from_slice(&field_id.to_be_bytes()); self.word_fid_docids.insert_add_u32(buffer, docid)?; buffer.clear(); buffer.extend_from_slice(word.as_bytes()); buffer.push(0); - buffer.extend_from_slice(&field_id.to_be_bytes()); + buffer.extend_from_slice(&position.to_be_bytes()); self.word_position_docids.insert_add_u32(buffer, docid)?; if self.current_docid.map_or(false, |id| docid != id) { @@ -337,13 +337,13 @@ impl WordDocidsCachedSorters { buffer.clear(); buffer.extend_from_slice(word.as_bytes()); buffer.push(0); - buffer.extend_from_slice(&position.to_be_bytes()); + buffer.extend_from_slice(&field_id.to_be_bytes()); self.word_fid_docids.insert_del_u32(buffer, docid)?; buffer.clear(); buffer.extend_from_slice(word.as_bytes()); buffer.push(0); - buffer.extend_from_slice(&field_id.to_be_bytes()); + buffer.extend_from_slice(&position.to_be_bytes()); self.word_position_docids.insert_del_u32(buffer, docid)?; if self.current_docid.map_or(false, |id| docid != id) {