diff --git a/milli/src/update/del_add.rs b/milli/src/update/del_add.rs index dc7c0409a..07a20b025 100644 --- a/milli/src/update/del_add.rs +++ b/milli/src/update/del_add.rs @@ -53,7 +53,9 @@ pub fn into_del_add_obkv( value_writer.insert(DelAdd::Addition, value)?; } value_writer.finish()?; - writer.insert(key, &value_buffer)?; + if !value_buffer.is_empty() { + writer.insert(key, &value_buffer)?; + } } writer.finish() diff --git a/milli/src/update/index_documents/extract/extract_word_position_docids.rs b/milli/src/update/index_documents/extract/extract_word_position_docids.rs index 1b9ec66ff..89b77d140 100644 --- a/milli/src/update/index_documents/extract/extract_word_position_docids.rs +++ b/milli/src/update/index_documents/extract/extract_word_position_docids.rs @@ -121,6 +121,7 @@ fn words_position_into_sorter( key } Both(key, _) => { + // both values needs to be kept because it will be used in other extractors. value_writer.insert(DelAdd::Deletion, document_id.to_ne_bytes()).unwrap(); value_writer.insert(DelAdd::Addition, document_id.to_ne_bytes()).unwrap(); key