diff --git a/quickpeep/src/config.rs b/quickpeep/src/config.rs index 75adac3..2dc3674 100644 --- a/quickpeep/src/config.rs +++ b/quickpeep/src/config.rs @@ -16,7 +16,13 @@ pub struct SeedCollectionConfig { #[derive(Debug, Clone, Deserialize)] pub struct WebConfig { pub web: WebOnlyConfig, - pub index: BackendConfig, + pub index: IndexConfig, +} + +#[derive(Debug, Clone, Deserialize)] +pub struct IndexConfig { + pub backend: BackendConfig, + // TODO icon_store } #[derive(Debug, Clone, Deserialize)] @@ -36,7 +42,7 @@ impl WebConfig { let mut web_config: WebConfig = ron::de::from_bytes(&file_bytes).context("Failed to parse web config")?; - match &mut web_config.index { + match &mut web_config.index.backend { BackendConfig::Tantivy(tantivy) => { tantivy.index_dir = config_dir.join(&tantivy.index_dir); } @@ -48,7 +54,7 @@ impl WebConfig { pub fn open_indexer_backend(&self) -> anyhow::Result> { // TODO deduplicate with the indexer crate - match &self.index { + match &self.index.backend { BackendConfig::Tantivy(tantivy) => { Ok(Box::new(TantivyBackend::open(&tantivy.index_dir)?)) }