diff --git a/meilidb-core/examples/from_file.rs b/meilidb-core/examples/from_file.rs index e00ff94f0..981f294ff 100644 --- a/meilidb-core/examples/from_file.rs +++ b/meilidb-core/examples/from_file.rs @@ -33,6 +33,9 @@ struct IndexCommand { #[structopt(long)] update_group_size: Option, + + #[structopt(long, parse(from_os_str))] + compact_to_path: Option, } #[derive(Debug, StructOpt)] @@ -165,6 +168,12 @@ fn index_command(command: IndexCommand, database: Database) -> Result<(), Box>(&self, path: P) -> ZResult { + self.env.copy_to_path(path, CompactionOption::Enabled) + } + pub fn indexes_names(&self) -> MResult> { let indexes = self.indexes.read().unwrap(); Ok(indexes.keys().cloned().collect())