Compare commits

...

3 Commits

Author SHA1 Message Date
Kerollmops
62ced0e3f1
Make cargo fmt happy 2025-01-30 11:09:54 +01:00
Clément Renault
71bb24f17e
Throw and error when the index is not found
Co-authored-by: Louis Dureuil <louis@meilisearch.com>
2025-01-30 11:07:43 +01:00
Clément Renault
c72f114b33
Fix english in the comments
Co-authored-by: Louis Dureuil <louis@meilisearch.com>
2025-01-30 11:07:09 +01:00

View File

@ -95,9 +95,9 @@ enum Command {
///
/// Note that the compaction will open the index, copy and compact the index into another file
/// **on the same disk as the index** and replace the previous index with the newly compacted
/// one. Which means that the disk must have enough room for at most two time the index size.
/// one. This means that the disk must have enough room for at most two times the index size.
///
/// To make sure not to loose any data, this tool takes a mutable transaction on the index
/// To make sure not to lose any data, this tool takes a mutable transaction on the index
/// before running the copy and compaction. This way the current indexation must finish before
/// the compaction operation can start. Once the compaction is done, the big index is replaced
/// by the compacted one and the mutable transaction is released.
@ -443,7 +443,8 @@ fn compact_index(db_path: PathBuf, index_name: &str) -> anyhow::Result<()> {
drop(new_file);
println!("Everything's done 🎉");
return Ok(());
}
Ok(())
bail!("Target index {index_name} not found!")
}