diff --git a/src/bin/indexer.rs b/src/bin/indexer.rs index ae0f83767..004f733b3 100644 --- a/src/bin/indexer.rs +++ b/src/bin/indexer.rs @@ -21,7 +21,7 @@ use rayon::prelude::*; use roaring::RoaringBitmap; use structopt::StructOpt; -use milli::heed_codec::{CsvStringRecordCodec, ByteorderXRoaringBitmapCodec}; +use milli::heed_codec::{CsvStringRecordCodec, BoRoaringBitmapCodec}; use milli::tokenizer::{simple_tokenizer, only_token}; use milli::{SmallVec32, Index, Position, DocumentId, BEU32}; @@ -364,7 +364,7 @@ impl Store { key.extend_from_slice(word.as_bytes()); // We serialize the positions into a buffer. let positions = RoaringBitmap::from_iter(positions.iter().cloned()); - let bytes = ByteorderXRoaringBitmapCodec::bytes_encode(&positions) + let bytes = BoRoaringBitmapCodec::bytes_encode(&positions) .with_context(|| format!("could not serialize positions"))?; // that we write under the generated key into MTBL if lmdb_key_valid_size(&key) { diff --git a/src/bin/infos.rs b/src/bin/infos.rs index fc68e6980..831e14110 100644 --- a/src/bin/infos.rs +++ b/src/bin/infos.rs @@ -336,13 +336,13 @@ fn average_number_of_words_by_doc(index: &Index, rtxn: &heed::RoTxn) -> anyhow:: fn average_number_of_positions_by_word(index: &Index, rtxn: &heed::RoTxn) -> anyhow::Result<()> { use heed::types::DecodeIgnore; - use milli::ByteorderXRoaringBitmapCodec; + use milli::BoRoaringBitmapCodec; let mut values_length = Vec::new(); let mut count = 0; let db = index.docid_word_positions.as_polymorph(); - for result in db.iter::<_, DecodeIgnore, ByteorderXRoaringBitmapCodec>(rtxn)? { + for result in db.iter::<_, DecodeIgnore, BoRoaringBitmapCodec>(rtxn)? { let ((), val) = result?; values_length.push(val.len() as u32); count += 1; diff --git a/src/heed_codec/byteorder_x_roaring_bitmap_codec.rs b/src/heed_codec/bo_roaring_bitmap_codec.rs similarity index 81% rename from src/heed_codec/byteorder_x_roaring_bitmap_codec.rs rename to src/heed_codec/bo_roaring_bitmap_codec.rs index 4f920959e..7ceb69f9a 100644 --- a/src/heed_codec/byteorder_x_roaring_bitmap_codec.rs +++ b/src/heed_codec/bo_roaring_bitmap_codec.rs @@ -2,9 +2,9 @@ use std::borrow::Cow; use byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use roaring::RoaringBitmap; -pub struct ByteorderXRoaringBitmapCodec; +pub struct BoRoaringBitmapCodec; -impl heed::BytesDecode<'_> for ByteorderXRoaringBitmapCodec { +impl heed::BytesDecode<'_> for BoRoaringBitmapCodec { type DItem = RoaringBitmap; fn bytes_decode(mut bytes: &[u8]) -> Option { @@ -16,7 +16,7 @@ impl heed::BytesDecode<'_> for ByteorderXRoaringBitmapCodec { } } -impl heed::BytesEncode<'_> for ByteorderXRoaringBitmapCodec { +impl heed::BytesEncode<'_> for BoRoaringBitmapCodec { type EItem = RoaringBitmap; fn bytes_encode(item: &Self::EItem) -> Option> { diff --git a/src/heed_codec/mod.rs b/src/heed_codec/mod.rs index 3a367dc6f..edae12351 100644 --- a/src/heed_codec/mod.rs +++ b/src/heed_codec/mod.rs @@ -1,11 +1,11 @@ mod beu32_str_codec; -mod byteorder_x_roaring_bitmap_codec; +mod bo_roaring_bitmap_codec; mod csv_string_record_codec; mod roaring_bitmap_codec; mod str_str_u8_codec; pub use self::beu32_str_codec::BEU32StrCodec; -pub use self::byteorder_x_roaring_bitmap_codec::ByteorderXRoaringBitmapCodec; +pub use self::bo_roaring_bitmap_codec::BoRoaringBitmapCodec; pub use self::csv_string_record_codec::CsvStringRecordCodec; pub use self::roaring_bitmap_codec::RoaringBitmapCodec; pub use self::str_str_u8_codec::StrStrU8Codec; diff --git a/src/lib.rs b/src/lib.rs index 850869064..1bc42928c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,7 @@ pub use self::search::{Search, SearchResult}; pub use self::criterion::{Criterion, default_criteria}; pub use self::heed_codec::{ RoaringBitmapCodec, BEU32StrCodec, StrStrU8Codec, - CsvStringRecordCodec, ByteorderXRoaringBitmapCodec, + CsvStringRecordCodec, BoRoaringBitmapCodec, }; pub type FastMap4 = HashMap>; @@ -42,7 +42,7 @@ pub struct Index { /// A word and all the documents ids containing the word. pub word_docids: Database, /// Maps a word and a document id (u32) to all the positions where the given word appears. - pub docid_word_positions: Database, + pub docid_word_positions: Database, /// Maps the proximity between a pair of words with all the docids where this relation appears. pub word_pair_proximity_docids: Database, /// Maps the document id to the document as a CSV line.