mod update_store; mod index_store; mod update_handler; use index_store::IndexStore; use std::path::Path; use std::sync::Arc; use milli::Index; use crate::option::IndexerOpts; use super::IndexController; pub struct LocalIndexController { indexes: IndexStore, } impl LocalIndexController { pub fn new(path: impl AsRef, opt: IndexerOpts) -> anyhow::Result { let indexes = IndexStore::new(path, opt)?; Ok(Self { indexes }) } } impl IndexController for LocalIndexController { fn add_documents>( &self, _index: S, _method: milli::update::IndexDocumentsMethod, _format: milli::update::UpdateFormat, _data: &[u8], ) -> anyhow::Result { todo!() } fn update_settings>(&self, _index_uid: S, _settings: super::Settings) -> anyhow::Result { todo!() } fn create_index>(&self, _index_uid: S) -> anyhow::Result<()> { todo!() } fn delete_index>(&self, _index_uid: S) -> anyhow::Result<()> { todo!() } fn swap_indices, S2: AsRef>(&self, _index1_uid: S1, _index2_uid: S2) -> anyhow::Result<()> { todo!() } fn index(&self, name: impl AsRef) -> anyhow::Result>> { let index = self.indexes.index(name)?.map(|(i, _)| i); Ok(index) } }