diff --git a/meilisearch-http/src/index_controller/index_actor/actor.rs b/meilisearch-http/src/index_controller/index_actor/actor.rs index 15d96b7ad..fc40a5090 100644 --- a/meilisearch-http/src/index_controller/index_actor/actor.rs +++ b/meilisearch-http/src/index_controller/index_actor/actor.rs @@ -31,9 +31,12 @@ pub struct IndexActor { } impl IndexActor { - pub fn new(receiver: mpsc::Receiver, store: S) -> anyhow::Result { - let options = IndexerOpts::default(); - let update_handler = UpdateHandler::new(&options)?; + pub fn new( + receiver: mpsc::Receiver, + store: S, + options: &IndexerOpts, + ) -> anyhow::Result { + let update_handler = UpdateHandler::new(options)?; let update_handler = Arc::new(update_handler); let receiver = Some(receiver); Ok(Self { diff --git a/meilisearch-http/src/index_controller/index_actor/handle_impl.rs b/meilisearch-http/src/index_controller/index_actor/handle_impl.rs index 231a3a44b..ceb2a8226 100644 --- a/meilisearch-http/src/index_controller/index_actor/handle_impl.rs +++ b/meilisearch-http/src/index_controller/index_actor/handle_impl.rs @@ -1,3 +1,4 @@ +use crate::option::IndexerOpts; use std::path::{Path, PathBuf}; use tokio::sync::{mpsc, oneshot}; @@ -148,11 +149,15 @@ impl IndexActorHandle for IndexActorHandleImpl { } impl IndexActorHandleImpl { - pub fn new(path: impl AsRef, index_size: usize) -> anyhow::Result { + pub fn new( + path: impl AsRef, + index_size: usize, + options: &IndexerOpts, + ) -> anyhow::Result { let (sender, receiver) = mpsc::channel(100); let store = MapIndexStore::new(path, index_size); - let actor = IndexActor::new(receiver, store)?; + let actor = IndexActor::new(receiver, store, options)?; tokio::task::spawn(actor.run()); Ok(Self { sender }) } diff --git a/meilisearch-http/src/index_controller/mod.rs b/meilisearch-http/src/index_controller/mod.rs index a90498b9c..83a97cd8f 100644 --- a/meilisearch-http/src/index_controller/mod.rs +++ b/meilisearch-http/src/index_controller/mod.rs @@ -110,7 +110,8 @@ impl IndexController { std::fs::create_dir_all(&path)?; let uuid_resolver = uuid_resolver::UuidResolverHandleImpl::new(&path)?; - let index_handle = index_actor::IndexActorHandleImpl::new(&path, index_size)?; + let index_handle = + index_actor::IndexActorHandleImpl::new(&path, index_size, &options.indexer_options)?; let update_handle = update_actor::UpdateActorHandleImpl::new( index_handle.clone(), &path,