Trait tantivy::query::Bm25StatisticsProvider
source · pub trait Bm25StatisticsProvider {
// Required methods
fn total_num_tokens(&self, field: Field) -> Result<u64>;
fn total_num_docs(&self) -> Result<u64>;
fn doc_freq(&self, term: &Term) -> Result<u64>;
}
Expand description
An interface to compute the statistics needed in BM25 scoring.
The standard implementation is a Searcher but you can also create your own to adjust the statistics.
Required Methods§
sourcefn total_num_tokens(&self, field: Field) -> Result<u64>
fn total_num_tokens(&self, field: Field) -> Result<u64>
The total number of tokens in a given field across all documents in the index.
sourcefn total_num_docs(&self) -> Result<u64>
fn total_num_docs(&self) -> Result<u64>
The total number of documents in the index.