From fa6c7f65cae9fcb232bcc671c82421304da47d25 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 25 Oct 2023 14:42:09 +0200 Subject: [PATCH] Add TmpIndex::delete_documents --- milli/src/index.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/milli/src/index.rs b/milli/src/index.rs index b20674d4c..64aff636b 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -1526,7 +1526,7 @@ pub(crate) mod tests { Ok(()) } - pub fn delete_document(&self, external_document_id: &str) { + pub fn delete_documents(&self, external_document_ids: Vec) { let mut wtxn = self.write_txn().unwrap(); let builder = IndexDocuments::new( @@ -1538,13 +1538,16 @@ pub(crate) mod tests { || false, ) .unwrap(); - let (builder, user_error) = - builder.remove_documents(vec![external_document_id.to_owned()]).unwrap(); + let (builder, user_error) = builder.remove_documents(external_document_ids).unwrap(); user_error.unwrap(); builder.execute().unwrap(); wtxn.commit().unwrap(); } + + pub fn delete_document(&self, external_document_id: &str) { + self.delete_documents(vec![external_document_id.to_string()]) + } } #[test]