diff --git a/meilidb-core/src/database.rs b/meilidb-core/src/database.rs index 0bdde55cb..72e5a1d0f 100644 --- a/meilidb-core/src/database.rs +++ b/meilidb-core/src/database.rs @@ -251,9 +251,9 @@ impl Database { self.env.copy_to_path(path, CompactionOption::Enabled) } - pub fn indexes_uids(&self) -> MResult> { + pub fn indexes_uids(&self) -> Vec { let indexes = self.indexes.read().unwrap(); - Ok(indexes.keys().cloned().collect()) + indexes.keys().cloned().collect() } pub fn common_store(&self) -> heed::PolyDatabase { diff --git a/meilidb-http/src/routes/index.rs b/meilidb-http/src/routes/index.rs index 4eb228f92..f6fe999f2 100644 --- a/meilidb-http/src/routes/index.rs +++ b/meilidb-http/src/routes/index.rs @@ -32,8 +32,7 @@ pub async fn list_indexes(ctx: Context) -> SResult { let indexes_uids = ctx .state() .db - .indexes_uids() - .map_err(ResponseError::internal)?; + .indexes_uids(); let env = &ctx.state().db.env; let mut reader = env.read_txn().map_err(ResponseError::internal)?; diff --git a/meilidb-http/src/routes/search.rs b/meilidb-http/src/routes/search.rs index e4500bc92..0551a278e 100644 --- a/meilidb-http/src/routes/search.rs +++ b/meilidb-http/src/routes/search.rs @@ -159,7 +159,6 @@ pub async fn search_multi_index(mut ctx: Context) -> SResult { .state() .db .indexes_uids() - .map_err(ResponseError::internal)? .into_iter() .collect(); }