add a test

This commit is contained in:
Tamo 2023-04-11 19:34:25 +02:00 committed by Louis Dureuil
parent 6df2ba93a9
commit 8af8aa5a33
No known key found for this signature in database
2 changed files with 125 additions and 0 deletions

View file

@ -225,6 +225,11 @@ impl Index<'_> {
self.service.delete(url).await
}
pub async fn delete_document_by_filter(&self, body: Value) -> (Value, StatusCode) {
let url = format!("/indexes/{}/documents/delete-batch", urlencode(self.uid.as_ref()));
self.service.post_encoded(url, body, self.encoder).await
}
pub async fn clear_all_documents(&self) -> (Value, StatusCode) {
let url = format!("/indexes/{}/documents", urlencode(self.uid.as_ref()));
self.service.delete(url).await