implement delete document batches

This commit is contained in:
mpostma
2021-02-12 17:39:14 +01:00
parent a8ba809656
commit c317af58bc
5 changed files with 68 additions and 7 deletions

View File

@ -72,6 +72,17 @@ impl Data {
Ok(update.into())
}
pub async fn delete_documents(
&self,
index: impl AsRef<str>,
document_ids: Vec<String>,
) -> anyhow::Result<UpdateStatus> {
let index_controller = self.index_controller.clone();
let index = index.as_ref().to_string();
let update = tokio::task::spawn_blocking(move || index_controller.delete_documents(index, document_ids)).await??;
Ok(update.into())
}
#[inline]
pub fn get_update_status(&self, index: impl AsRef<str>, uid: u64) -> anyhow::Result<Option<UpdateStatus>> {
self.index_controller.update_status(index, uid)