From eaf28b0628b202d02eb0334781dcb04dbd2b2937 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 29 Jun 2022 06:44:16 +0200 Subject: [PATCH] Apply review suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Renault --- milli/src/update/delete_documents.rs | 2 ++ milli/src/update/index_documents/mod.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/milli/src/update/delete_documents.rs b/milli/src/update/delete_documents.rs index 564b729ea..0221ebc6f 100644 --- a/milli/src/update/delete_documents.rs +++ b/milli/src/update/delete_documents.rs @@ -20,6 +20,8 @@ use crate::{ RoaringBitmapCodec, SmallString32, BEU32, }; +/// The threshold we use to determine after which number of documents we want to clear the +/// soft-deleted database and delete documents for real. const DELETE_DOCUMENTS_THRESHOLD: u64 = 100_000; pub struct DeleteDocuments<'t, 'u, 'i> { diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 33d6396c5..ba428f078 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -719,7 +719,7 @@ mod tests { assert_eq!(count, 1); // Check that we get only one document from the database. - // Since the document has been deleted and re-inserted, its internal docid has has been incremented to 1 + // Since the document has been deleted and re-inserted, its internal docid has been incremented to 1 let docs = index.documents(&rtxn, Some(1)).unwrap(); assert_eq!(docs.len(), 1); let (id, doc) = docs[0];