mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01:00
remove one useless txn
This commit is contained in:
parent
3680a6bf1e
commit
6df2ba93a9
@ -1489,10 +1489,9 @@ impl IndexScheduler {
|
|||||||
fn delete_document_by_filter(filter: &serde_json::Value, index: Index) -> Result<u64> {
|
fn delete_document_by_filter(filter: &serde_json::Value, index: Index) -> Result<u64> {
|
||||||
let filter = Filter::from_json(filter)?;
|
let filter = Filter::from_json(filter)?;
|
||||||
Ok(if let Some(filter) = filter {
|
Ok(if let Some(filter) = filter {
|
||||||
let index_rtxn = index.read_txn()?;
|
|
||||||
|
|
||||||
let candidates = filter.evaluate(&index_rtxn, &index)?;
|
|
||||||
let mut wtxn = index.write_txn()?;
|
let mut wtxn = index.write_txn()?;
|
||||||
|
|
||||||
|
let candidates = filter.evaluate(&wtxn, &index)?;
|
||||||
let mut delete_operation = DeleteDocuments::new(&mut wtxn, &index)?;
|
let mut delete_operation = DeleteDocuments::new(&mut wtxn, &index)?;
|
||||||
delete_operation.delete_documents(&candidates);
|
delete_operation.delete_documents(&candidates);
|
||||||
let deleted_documents =
|
let deleted_documents =
|
||||||
|
Loading…
Reference in New Issue
Block a user