pub struct BlockMaxIndex { /* private fields */ }Implementations§
Source§impl BlockMaxIndex
impl BlockMaxIndex
pub fn new(block_size: usize) -> StorageBackendResult<Self>
pub fn block_size(&self) -> usize
pub fn set_block_maxes( &mut self, table: &str, field: &str, term: &str, scores: Vec<f64>, ) -> StorageBackendResult<()>
Sourcepub fn build<S: BlockMaxScorer + ?Sized>(
&mut self,
posting_list: &PostingList,
scorer: &S,
field: &str,
term: &str,
table: &str,
) -> StorageBackendResult<()>
pub fn build<S: BlockMaxScorer + ?Sized>( &mut self, posting_list: &PostingList, scorer: &S, field: &str, term: &str, table: &str, ) -> StorageBackendResult<()>
Compute and store per-block maxima for posting_list. Each
block’s max is max_{e in block} scorer.score(tf(e), tf(e), df) and
uses term frequency as the document-length stand-in when none is given.
pub fn block_max( &self, table: &str, field: &str, term: &str, block_idx: usize, ) -> f64
pub fn num_blocks(&self, table: &str, field: &str, term: &str) -> usize
Sourcepub fn block_maxes(
&self,
table: &str,
field: &str,
term: &str,
) -> Option<&[f64]>
pub fn block_maxes( &self, table: &str, field: &str, term: &str, ) -> Option<&[f64]>
Borrow all block scores for one posting without repeated key construction. BMW uses this to precompute suffix bounds once per query.
Sourcepub fn block_index_for(&self, position: usize) -> StorageBackendResult<usize>
pub fn block_index_for(&self, position: usize) -> StorageBackendResult<usize>
Block index for a given posting-list cursor position.
pub fn clear(&mut self)
pub fn save_to_sqlite(&self, conn: &Connection) -> Result<()>
pub fn load_from_sqlite(&mut self, conn: &Connection) -> Result<()>
Trait Implementations§
Source§impl Clone for BlockMaxIndex
impl Clone for BlockMaxIndex
Source§fn clone(&self) -> BlockMaxIndex
fn clone(&self) -> BlockMaxIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockMaxIndex
impl Debug for BlockMaxIndex
Auto Trait Implementations§
impl Freeze for BlockMaxIndex
impl RefUnwindSafe for BlockMaxIndex
impl Send for BlockMaxIndex
impl Sync for BlockMaxIndex
impl Unpin for BlockMaxIndex
impl UnsafeUnpin for BlockMaxIndex
impl UnwindSafe for BlockMaxIndex
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