pub struct CorpusStats {
pub n_docs: f64,
pub avgdl: f64,
pub df: HashMap<Vec<u8>, u32>,
}Expand description
Corpus statistics supplied from outside a segment, for scoring one shard’s documents against the whole corpus rather than its own slice.
A cross-shard text query builds this by summing each shard’s local
n_docs / total_len and, for each query token, its df. df
need only carry the query’s tokens — the values a query actually
scores with — which is why global BM25 does not need a whole-corpus
df table.
Fields§
§n_docs: f64Total documents across the corpus.
avgdl: f64Mean document length (unweighted tokens) across the corpus.
df: HashMap<Vec<u8>, u32>Global document frequency per query token; a token missing here falls back to the segment’s local list length.
Auto Trait Implementations§
impl Freeze for CorpusStats
impl RefUnwindSafe for CorpusStats
impl Send for CorpusStats
impl Sync for CorpusStats
impl Unpin for CorpusStats
impl UnsafeUnpin for CorpusStats
impl UnwindSafe for CorpusStats
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