mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Add TmpIndex::delete_documents
This commit is contained in:
parent
113527f466
commit
fa6c7f65ca
@ -1526,7 +1526,7 @@ pub(crate) mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_document(&self, external_document_id: &str) {
|
pub fn delete_documents(&self, external_document_ids: Vec<String>) {
|
||||||
let mut wtxn = self.write_txn().unwrap();
|
let mut wtxn = self.write_txn().unwrap();
|
||||||
|
|
||||||
let builder = IndexDocuments::new(
|
let builder = IndexDocuments::new(
|
||||||
@ -1538,13 +1538,16 @@ pub(crate) mod tests {
|
|||||||
|| false,
|
|| false,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let (builder, user_error) =
|
let (builder, user_error) = builder.remove_documents(external_document_ids).unwrap();
|
||||||
builder.remove_documents(vec![external_document_id.to_owned()]).unwrap();
|
|
||||||
user_error.unwrap();
|
user_error.unwrap();
|
||||||
builder.execute().unwrap();
|
builder.execute().unwrap();
|
||||||
|
|
||||||
wtxn.commit().unwrap();
|
wtxn.commit().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn delete_document(&self, external_document_id: &str) {
|
||||||
|
self.delete_documents(vec![external_document_id.to_string()])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user