pub struct TextCandidateScorer { /* private fields */ }Expand description
Scores aligned emitted query terms, including duplicates, after support acceptance.
Implementations§
Source§impl TextCandidateScorer
impl TextCandidateScorer
pub fn new( mode: &ScoringMode, stats: IndexStats, document_frequencies: &[u64], ) -> Result<Self, TextSearchError>
Sourcepub fn new_budgeted(
mode: &ScoringMode,
stats: IndexStats,
document_frequencies: &[u64],
budget: &MemoryBudget,
poll: impl FnMut() -> Result<(), TextSearchError>,
) -> Result<Self, TextSearchError>
pub fn new_budgeted( mode: &ScoringMode, stats: IndexStats, document_frequencies: &[u64], budget: &MemoryBudget, poll: impl FnMut() -> Result<(), TextSearchError>, ) -> Result<Self, TextSearchError>
Reserve query IDFs and scalar statistics from the caller’s shared runtime allowance.
Only scalar statistics are needed because frequencies arrive in emitted query order. Unused vocabulary maps are dropped, and the native scorer is stored inline. The callback covers construction and IDF preparation; partial owners are released on failure.
pub fn score_document( &mut self, document_length: u64, term_frequencies: &[u64], ) -> Result<f64, TextSearchError>
Sourcepub fn score_document_with_control(
&self,
document_length: u64,
term_frequencies: &[u64],
poll: impl FnMut() -> Result<(), TextSearchError>,
) -> Result<f64, TextSearchError>
pub fn score_document_with_control( &self, document_length: u64, term_frequencies: &[u64], poll: impl FnMut() -> Result<(), TextSearchError>, ) -> Result<f64, TextSearchError>
Sum native term contributions in emitted order and apply calibration once, without a temporary score vector.
Auto Trait Implementations§
impl Freeze for TextCandidateScorer
impl RefUnwindSafe for TextCandidateScorer
impl Send for TextCandidateScorer
impl Sync for TextCandidateScorer
impl Unpin for TextCandidateScorer
impl UnsafeUnpin for TextCandidateScorer
impl UnwindSafe for TextCandidateScorer
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