mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
implement clear all documents
This commit is contained in:
@ -62,6 +62,16 @@ impl Data {
|
||||
Ok(update.into())
|
||||
}
|
||||
|
||||
pub async fn clear_documents(
|
||||
&self,
|
||||
index: impl AsRef<str>,
|
||||
) -> 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.clear_documents(index)).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)
|
||||
|
Reference in New Issue
Block a user