Fix wod pair proximity error when nothing has to be extracted

This commit is contained in:
ManyTheFish 2024-04-15 11:28:30 +02:00
parent 5ab901dd30
commit eaf113ef34
1 changed files with 6 additions and 5 deletions

View File

@ -32,11 +32,12 @@ pub fn extract_word_pair_proximity_docids<R: io::Read + io::Seek>(
// 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();