pub struct SparseSkipEntry {
pub first_doc: DocId,
pub last_doc: DocId,
pub offset: u64,
pub length: u32,
pub max_weight: f32,
}Expand description
Skip entry for sparse posting lists with block-max support
Extends the basic skip entry with max_weight for block-max pruning optimization.
Used for lazy block loading - only skip list is loaded, blocks loaded on-demand.
Fields§
§first_doc: DocIdFirst doc_id in the block (absolute)
last_doc: DocIdLast doc_id in the block
offset: u64Byte offset to block data (relative to data section start)
length: u32Byte length of block data
max_weight: f32Maximum weight in this block (for Block-Max optimization)
Implementations§
Source§impl SparseSkipEntry
impl SparseSkipEntry
pub fn new( first_doc: DocId, last_doc: DocId, offset: u64, length: u32, max_weight: f32, ) -> Self
Sourcepub fn block_max_contribution(&self, query_weight: f32) -> f32
pub fn block_max_contribution(&self, query_weight: f32) -> f32
Compute the maximum possible contribution of this block to a dot product
For a query dimension with weight query_weight, the maximum contribution
from this block is query_weight * max_weight.
Sourcepub fn from_bytes(b: &[u8]) -> Self
pub fn from_bytes(b: &[u8]) -> Self
Read a skip entry from a 24-byte LE slice (zero-copy, no I/O).
Sourcepub fn write_to_vec(&self, buf: &mut Vec<u8>)
pub fn write_to_vec(&self, buf: &mut Vec<u8>)
Append the 24-byte LE representation to a byte buffer.
Sourcepub fn read_at(skip_bytes: &[u8], idx: usize) -> Self
pub fn read_at(skip_bytes: &[u8], idx: usize) -> Self
Read a skip entry at idx from a contiguous skip byte slice.
Trait Implementations§
Source§impl Clone for SparseSkipEntry
impl Clone for SparseSkipEntry
Source§fn clone(&self) -> SparseSkipEntry
fn clone(&self) -> SparseSkipEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparseSkipEntry
impl Debug for SparseSkipEntry
Source§impl PartialEq for SparseSkipEntry
impl PartialEq for SparseSkipEntry
impl Copy for SparseSkipEntry
impl StructuralPartialEq for SparseSkipEntry
Auto Trait Implementations§
impl Freeze for SparseSkipEntry
impl RefUnwindSafe for SparseSkipEntry
impl Send for SparseSkipEntry
impl Sync for SparseSkipEntry
impl Unpin for SparseSkipEntry
impl UnsafeUnpin for SparseSkipEntry
impl UnwindSafe for SparseSkipEntry
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.