implement retrieve one document

This commit is contained in:
mpostma 2021-03-04 15:09:00 +01:00
parent f3d65ec5e9
commit 581dcd5735
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
5 changed files with 109 additions and 58 deletions

View file

@ -172,6 +172,20 @@ impl IndexController {
Ok(documents)
}
pub async fn document(
&self,
index: String,
doc_id: String,
attributes_to_retrieve: Option<Vec<String>>,
) -> anyhow::Result<Document> {
let uuid = self.uuid_resolver
.resolve(index.clone())
.await?
.with_context(|| format!("Index {:?} doesn't exist", index))?;
let document = self.index_handle.document(uuid, doc_id, attributes_to_retrieve).await?;
Ok(document)
}
fn update_index(&self, name: String, index_settings: IndexSettings) -> anyhow::Result<IndexMetadata> {
todo!()
}