diff --git a/meilidb-data/src/database/index/mod.rs b/meilidb-data/src/database/index/mod.rs index 4d35bf690..f58974f66 100644 --- a/meilidb-data/src/database/index/mod.rs +++ b/meilidb-data/src/database/index/mod.rs @@ -114,7 +114,7 @@ pub struct IndexStats { #[derive(Clone)] pub struct Index { - pub(crate) cache: ArcSwap, + pub(crate) cache: Arc>, // TODO this will be a snapshot in the future main_index: MainIndex, @@ -185,7 +185,7 @@ impl Index { }; let cache = Cache { words, synonyms, schema, ranked_map }; - let cache = ArcSwap::from_pointee(cache); + let cache = Arc::new(ArcSwap::from_pointee(cache)); let index = Index { cache,