mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-28 17:21:03 +00:00
WIP: refactor IndexController
change the architecture of the index controller to allow it to own an index store.
This commit is contained in:
@ -107,10 +107,10 @@ impl Data {
|
||||
pub fn search<S: AsRef<str>>(&self, index: S, search_query: SearchQuery) -> anyhow::Result<SearchResult> {
|
||||
let start = Instant::now();
|
||||
let index = self.indexes
|
||||
.get(index)?
|
||||
.get(&index)?
|
||||
.ok_or_else(|| Error::OpenIndex(format!("Index {} doesn't exists.", index.as_ref())))?;
|
||||
|
||||
let Results { found_words, documents_ids, nb_hits, limit, .. } = index.search(search_query)?;
|
||||
let Results { found_words, documents_ids, nb_hits, limit, .. } = index.search(&search_query)?;
|
||||
|
||||
let fields_ids_map = index.fields_ids_map()?;
|
||||
|
||||
|
Reference in New Issue
Block a user