Introduce an heed codec that reduce the size of small amount of serialized integers

This commit is contained in:
Kerollmops
2020-09-07 15:42:20 +02:00
committed by Clément Renault
parent 3e2250423c
commit 5664c37539
5 changed files with 50 additions and 14 deletions

View File

@ -257,13 +257,13 @@ fn average_number_of_words_by_doc(index: &Index, rtxn: &heed::RoTxn) -> anyhow::
fn average_number_of_positions(index: &Index, rtxn: &heed::RoTxn) -> anyhow::Result<()> {
use heed::types::DecodeIgnore;
use milli::RoaringBitmapCodec;
use milli::ByteorderXRoaringBitmapCodec;
let mut values_length = Vec::new();
let mut count = 0;
let iter = index.docid_word_positions.as_polymorph().iter::<_, DecodeIgnore, RoaringBitmapCodec>(rtxn)?;
for result in iter {
let db = index.docid_word_positions.as_polymorph();
for result in db.iter::<_, DecodeIgnore, ByteorderXRoaringBitmapCodec>(rtxn)? {
let ((), val) = result?;
values_length.push(val.len() as u32);
count += 1;