From fe04e51a49c6e01e07a4c75aae1709775658ef30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 19 Nov 2024 16:02:57 +0100 Subject: [PATCH] One more --- crates/milli/src/update/index_documents/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/milli/src/update/index_documents/mod.rs b/crates/milli/src/update/index_documents/mod.rs index 8d038cf2a..532e6cca5 100644 --- a/crates/milli/src/update/index_documents/mod.rs +++ b/crates/milli/src/update/index_documents/mod.rs @@ -3110,12 +3110,16 @@ mod tests { ]), ) .unwrap(); + wtxn.commit().unwrap(); + let mut wtxn = index.write_txn().unwrap(); let deleted_external_ids = ["1_7", "1_52"]; let deleted_internal_ids = delete_documents(&mut wtxn, &index, &deleted_external_ids); + wtxn.commit().unwrap(); + let rtxn = index.read_txn().unwrap(); // list all documents - let results = index.all_documents(&wtxn).unwrap(); + let results = index.all_documents(&rtxn).unwrap(); for result in results { let (id, _) = result.unwrap(); assert!( @@ -3126,7 +3130,7 @@ mod tests { } // list internal document ids - let results = index.documents_ids(&wtxn).unwrap(); + let results = index.documents_ids(&rtxn).unwrap(); for id in results { assert!( !deleted_internal_ids.contains(&id), @@ -3134,9 +3138,6 @@ mod tests { id ); } - wtxn.commit().unwrap(); - - let rtxn = index.read_txn().unwrap(); // get internal docids from deleted external document ids let results = index.external_documents_ids();