2021-09-21 19:23:22 +08:00
|
|
|
#[macro_use]
|
|
|
|
pub mod error;
|
|
|
|
pub mod options;
|
|
|
|
|
|
|
|
pub mod index;
|
|
|
|
pub mod index_controller;
|
|
|
|
|
2021-10-06 19:01:02 +08:00
|
|
|
pub use index_controller::updates::store::Update;
|
|
|
|
pub use index_controller::MeiliSearch;
|
2021-09-21 19:23:22 +08:00
|
|
|
|
2021-09-29 04:08:03 +08:00
|
|
|
pub use milli;
|
|
|
|
|
2021-09-27 22:48:03 +08:00
|
|
|
mod compression;
|
2021-09-28 17:59:55 +08:00
|
|
|
mod document_formats;
|
2021-09-27 22:48:03 +08:00
|
|
|
|
2021-09-21 19:23:22 +08:00
|
|
|
use walkdir::WalkDir;
|
|
|
|
|
|
|
|
pub trait EnvSizer {
|
|
|
|
fn size(&self) -> u64;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl EnvSizer for heed::Env {
|
|
|
|
fn size(&self) -> u64 {
|
|
|
|
WalkDir::new(self.path())
|
|
|
|
.into_iter()
|
|
|
|
.filter_map(|entry| entry.ok())
|
|
|
|
.filter_map(|entry| entry.metadata().ok())
|
|
|
|
.filter(|metadata| metadata.is_file())
|
|
|
|
.fold(0, |acc, m| acc + m.len())
|
|
|
|
}
|
|
|
|
}
|