Use the RoaringBitmapLenCodec to retrieve the count of documents

This commit is contained in:
Kerollmops 2021-03-09 10:24:27 +01:00
parent 7a3ce9bb1d
commit f51eb46c69
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 9 additions and 8 deletions

View file

@ -17,7 +17,7 @@ impl<'t, 'u, 'i> ClearDocuments<'t, 'u, 'i> {
ClearDocuments { wtxn, index, _update_id: update_id }
}
pub fn execute(self) -> anyhow::Result<usize> {
pub fn execute(self) -> anyhow::Result<u64> {
let Index {
env: _env,
main: _main,

View file

@ -51,7 +51,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
Some(docid)
}
pub fn execute(self) -> anyhow::Result<usize> {
pub fn execute(self) -> anyhow::Result<u64> {
// We retrieve the current documents ids that are in the database.
let mut documents_ids = self.index.documents_ids(self.wtxn)?;
@ -308,7 +308,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
drop(iter);
Ok(self.documents_ids.len() as usize)
Ok(self.documents_ids.len())
}
}