implement get single index

This commit is contained in:
mpostma 2021-03-06 20:17:58 +01:00
parent 281a445998
commit ced32afd9f
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
3 changed files with 15 additions and 7 deletions

View file

@ -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 {