mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Add delete_document_using_wtxn to TempIndex
This commit is contained in:
parent
652ac3052d
commit
ae4ec8ea55
@ -1526,11 +1526,13 @@ pub(crate) mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_documents(&self, external_document_ids: Vec<String>) {
|
pub fn delete_documents_using_wtxn<'t>(
|
||||||
let mut wtxn = self.write_txn().unwrap();
|
&'t self,
|
||||||
|
wtxn: &mut RwTxn<'t, '_>,
|
||||||
|
external_document_ids: Vec<String>,
|
||||||
|
) {
|
||||||
let builder = IndexDocuments::new(
|
let builder = IndexDocuments::new(
|
||||||
&mut wtxn,
|
wtxn,
|
||||||
self,
|
self,
|
||||||
&self.indexer_config,
|
&self.indexer_config,
|
||||||
self.index_documents_config.clone(),
|
self.index_documents_config.clone(),
|
||||||
@ -1541,6 +1543,12 @@ pub(crate) mod tests {
|
|||||||
let (builder, user_error) = builder.remove_documents(external_document_ids).unwrap();
|
let (builder, user_error) = builder.remove_documents(external_document_ids).unwrap();
|
||||||
user_error.unwrap();
|
user_error.unwrap();
|
||||||
builder.execute().unwrap();
|
builder.execute().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn delete_documents(&self, external_document_ids: Vec<String>) {
|
||||||
|
let mut wtxn = self.write_txn().unwrap();
|
||||||
|
|
||||||
|
self.delete_documents_using_wtxn(&mut wtxn, external_document_ids);
|
||||||
|
|
||||||
wtxn.commit().unwrap();
|
wtxn.commit().unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user