pub struct TermCursor<'segment> {
pub stream: TermStream<'segment>,
pub df: Df,
pub scorer: TermScorer,
pub upper_bound: f64,
}Expand description
One query term prepared for pruning within one segment.
The cursor is a view over the sealed streams, not a copy of them. It
holds no entry array: advance and seek walk block metadata and
decode only the blocks the traversal actually lands in.
Fields§
§stream: TermStream<'segment>The merged sealed postings for this term across the weighted fields.
df: DfStore-wide document frequency.
scorer: TermScorerThis term’s hoisted scoring constants.
Built once per (term, segment) so the inner loops never recompute
idf or avgdl. See crate::fts::bm25::TermScorer.
upper_bound: f64Largest contribution this term can make to any document.
Implementations§
Source§impl TermCursor<'_>
impl TermCursor<'_>
Sourcepub fn current_tf(&mut self) -> Option<u32>
pub fn current_tf(&mut self) -> Option<u32>
Returns the merged term frequency at the cursor.
The first ask against a block pays that block’s tf decode; rows that are skipped rather than scored never pay it.
Sourcepub fn seek(&mut self, row: u32)
pub fn seek(&mut self, row: u32)
Advances to the first row at or after row.
Skip keys ascend, so the first block that can hold row is a binary
search over metadata rows; the blocks between are never decoded.
Sourcepub fn current_block_max(&self) -> f64
pub fn current_block_max(&self) -> f64
Returns the bound of the block the cursor currently sits in.
Read from the stored impact pairs and evaluated against this query’s
live statistics; see crate::fts::sealed.