implement clear documents

This commit is contained in:
mpostma 2021-03-04 16:04:12 +01:00
parent ae5581d37c
commit a955e04ab6
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
3 changed files with 18 additions and 17 deletions

View file

@ -106,8 +106,12 @@ impl IndexController {
Ok(status)
}
fn clear_documents(&self, index: String) -> anyhow::Result<UpdateStatus> {
todo!()
pub async fn clear_documents(&self, index: String) -> anyhow::Result<UpdateStatus> {
let uuid = self.uuid_resolver.resolve(index).await.unwrap().unwrap();
let meta = UpdateMeta::ClearDocuments;
let (_, receiver) = mpsc::channel(1);
let status = self.update_handle.update(meta, receiver, uuid).await?;
Ok(status)
}
pub async fn delete_documents(&self, index: String, document_ids: Vec<String>) -> anyhow::Result<UpdateStatus> {