diff --git a/crates/core/src/config.rs b/crates/core/src/config.rs index e0287c72..58d7d99d 100644 --- a/crates/core/src/config.rs +++ b/crates/core/src/config.rs @@ -351,7 +351,7 @@ pub struct RedbIndexConfig { } /// Configuration for the Fjall index backend. -#[derive(Serialize, Deserialize, Clone, Debug, Default)] +#[derive(Serialize, Deserialize, Clone, Debug)] pub struct FjallIndexConfig { /// Optional path override. If relative, resolved from storage root. /// If not specified, defaults to `/index`. @@ -360,23 +360,37 @@ pub struct FjallIndexConfig { /// Size (in MB) of memory allocated for caching. #[serde(default)] pub cache: Option, - /// Maximum journal size in MB. + /// Maximum journal size in MB (default: 1024). #[serde(default)] pub max_journal_size: Option, - /// Flush journal after each commit. + /// Flush journal after each commit (default: false). #[serde(default)] pub flush_on_commit: Option, - /// L0 compaction threshold (default: 4, lower = more aggressive). + /// L0 compaction threshold (default: 8, lower = more aggressive). #[serde(default)] pub l0_threshold: Option, - /// Number of background compaction worker threads. + /// Number of background compaction worker threads (default: 8). #[serde(default)] pub worker_threads: Option, - /// Memtable size in MB before flush (default: 64). + /// Memtable size in MB before flush (default: 128). #[serde(default)] pub memtable_size_mb: Option, } +impl Default for FjallIndexConfig { + fn default() -> Self { + Self { + path: None, + cache: None, + max_journal_size: Some(1024), + flush_on_commit: Some(false), + l0_threshold: Some(8), + worker_threads: Some(8), + memtable_size_mb: Some(128), + } + } +} + /// Index store configuration. #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(tag = "backend", rename_all = "lowercase")]