Filter from script_language_docids database soft deleted documents

This commit is contained in:
f3r10 2022-10-14 16:22:42 -05:00 committed by ManyTheFish
parent a27f329e3a
commit 34d04f3d3f

View File

@ -1199,7 +1199,9 @@ impl Index {
/* script language docids */ /* script language docids */
/// Retrieve all the documents ids that correspond with (Script, Language) key, `None` if it is any. /// Retrieve all the documents ids that correspond with (Script, Language) key, `None` if it is any.
pub fn script_language_documents_ids(&self, rtxn: &RoTxn, key: &(Script, Language)) -> heed::Result<Option<RoaringBitmap>> { pub fn script_language_documents_ids(&self, rtxn: &RoTxn, key: &(Script, Language)) -> heed::Result<Option<RoaringBitmap>> {
self.script_language_docids.get(rtxn, key) let soft_deleted_documents = self.soft_deleted_documents_ids(rtxn)?;
let doc_ids = self.script_language_docids.get(rtxn, key)?;
Ok(doc_ids.map(|ids| ids - soft_deleted_documents))
} }
} }