From 67577a37608ab6b27f6e6846270b5ae0e20c74eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 4 Oct 2020 17:31:12 +0200 Subject: [PATCH] It is an error to merge docid word positions --- src/bin/indexer.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bin/indexer.rs b/src/bin/indexer.rs index 3a40bb179..fbf315a75 100644 --- a/src/bin/indexer.rs +++ b/src/bin/indexer.rs @@ -601,9 +601,8 @@ fn word_docids_merge(_key: &[u8], values: &[Vec]) -> Result, ()> { Ok(vec) } -fn docid_word_positions_merge(_key: &[u8], values: &[Vec]) -> Result, ()> { - assert!(values.windows(2).all(|vs| vs[0] == vs[1])); - Ok(values[0].to_vec()) +fn docid_word_positions_merge(key: &[u8], _values: &[Vec]) -> Result, ()> { + panic!("merging word docid positions is an error ({:?})", key.as_bstr()) } fn words_pairs_proximities_docids_merge(_key: &[u8], values: &[Vec]) -> Result, ()> { @@ -621,7 +620,7 @@ fn words_pairs_proximities_docids_merge(_key: &[u8], values: &[Vec]) -> Resu } fn documents_merge(key: &[u8], _values: &[Vec]) -> Result, ()> { - panic!("impossible to merge documents ({:?})", key.as_bstr()) + panic!("merging documents is an error ({:?})", key.as_bstr()) } fn merge_into_lmdb_database(