mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
implement get single index
This commit is contained in:
parent
281a445998
commit
ced32afd9f
3 changed files with 15 additions and 7 deletions
|
@ -239,6 +239,18 @@ impl IndexController {
|
|||
let result = self.index_handle.search(uuid, query).await?;
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
pub async fn get_index(&self, name: String) -> anyhow::Result<Option<IndexMetadata>> {
|
||||
let uuid = self.uuid_resolver.resolve(name.clone()).await?;
|
||||
if let Some(uuid) = uuid {
|
||||
let result = self.index_handle
|
||||
.get_index_meta(uuid)
|
||||
.await?
|
||||
.map(|meta| IndexMetadata { name, meta });
|
||||
return Ok(result)
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_arc_ownership_blocking<T>(mut item: Arc<T>) -> T {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue