From eaf113ef34c84e213dfcc96cdc2bc08837a45390 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 15 Apr 2024 11:28:30 +0200 Subject: [PATCH] Fix wod pair proximity error when nothing has to be extracted --- .../extract/extract_word_pair_proximity_docids.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/milli/src/update/index_documents/extract/extract_word_pair_proximity_docids.rs b/milli/src/update/index_documents/extract/extract_word_pair_proximity_docids.rs index e185566ca..23f70ccd2 100644 --- a/milli/src/update/index_documents/extract/extract_word_pair_proximity_docids.rs +++ b/milli/src/update/index_documents/extract/extract_word_pair_proximity_docids.rs @@ -32,11 +32,12 @@ pub fn extract_word_pair_proximity_docids( // early return if the data shouldn't be deleted nor created. if !any_deletion && !any_addition { - return tempfile::tempfile() - .map_err(Into::into) - .map(BufReader::new) - .and_then(grenad::Reader::new) - .map_err(Into::into); + let writer = create_writer( + indexer.chunk_compression_type, + indexer.chunk_compression_level, + tempfile::tempfile()?, + ); + return writer_into_reader(writer); } let max_memory = indexer.max_memory_by_thread();