pub struct EliasFanoPostingList {
pub doc_ids: EliasFano,
pub term_freqs: Vec<u8>,
pub tf_bits: u8,
pub max_tf: u32,
pub blocks: Vec<EFBlockInfo>,
pub max_score: f32,
}Expand description
Elias-Fano encoded posting list with term frequencies and BlockMax support
Fields§
§doc_ids: EliasFanoDocument IDs (Elias-Fano encoded)
term_freqs: Vec<u8>Term frequencies (packed, using minimal bits)
tf_bits: u8Bits per term frequency
max_tf: u32Maximum term frequency (for BM25 upper bound)
blocks: Vec<EFBlockInfo>Block metadata for BlockMax WAND
max_score: f32Global maximum score across all blocks
Implementations§
Source§impl EliasFanoPostingList
impl EliasFanoPostingList
Sourcepub fn compute_bm25_upper_bound(max_tf: u32, idf: f32) -> f32
pub fn compute_bm25_upper_bound(max_tf: u32, idf: f32) -> f32
Compute BM25 upper bound score for a given max_tf and IDF
Sourcepub fn from_postings(doc_ids: &[u32], term_freqs: &[u32]) -> Self
pub fn from_postings(doc_ids: &[u32], term_freqs: &[u32]) -> Self
Create from doc_ids and term frequencies (without IDF - for backwards compatibility)
Sourcepub fn from_postings_with_idf(
doc_ids: &[u32],
term_freqs: &[u32],
idf: f32,
) -> Self
pub fn from_postings_with_idf( doc_ids: &[u32], term_freqs: &[u32], idf: f32, ) -> Self
Create from doc_ids and term frequencies with IDF for block-max scores
Sourcepub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
pub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
Deserialize
Sourcepub fn num_blocks(&self) -> usize
pub fn num_blocks(&self) -> usize
Get number of blocks
Sourcepub fn block_for_pos(&self, pos: u32) -> usize
pub fn block_for_pos(&self, pos: u32) -> usize
Get block containing position
Sourcepub fn iterator(&self) -> EliasFanoPostingIterator<'_>
pub fn iterator(&self) -> EliasFanoPostingIterator<'_>
Create iterator
Trait Implementations§
Source§impl Clone for EliasFanoPostingList
impl Clone for EliasFanoPostingList
Source§fn clone(&self) -> EliasFanoPostingList
fn clone(&self) -> EliasFanoPostingList
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EliasFanoPostingList
impl RefUnwindSafe for EliasFanoPostingList
impl Send for EliasFanoPostingList
impl Sync for EliasFanoPostingList
impl Unpin for EliasFanoPostingList
impl UnwindSafe for EliasFanoPostingList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more