pub struct Bm25Params {
pub k1: f32,
pub b: f32,
}Expand description
Per-field BM25 parameters (indexed<k1: ..., b: ...> in the schema).
Fields§
§k1: f32§b: f32Implementations§
Source§impl Bm25Params
impl Bm25Params
Sourcepub fn for_field(schema: &Schema, field: Field) -> Self
pub fn for_field(schema: &Schema, field: Field) -> Self
Resolve a field’s parameters from its schema entry.
Sourcepub fn score(self, tf: f32, idf: f32, doc_len: f32, avg_doc_len: f32) -> f32
pub fn score(self, tf: f32, idf: f32, doc_len: f32, avg_doc_len: f32) -> f32
BM25 score of one term occurrence set.
Sourcepub fn score_boosted(
self,
tf: f32,
idf: f32,
doc_len: f32,
avg_doc_len: f32,
field_boost: f32,
) -> f32
pub fn score_boosted( self, tf: f32, idf: f32, doc_len: f32, avg_doc_len: f32, field_boost: f32, ) -> f32
BM25F score with a field boost.
Sourcepub fn upper_bound(self, max_tf: f32, idf: f32) -> f32
pub fn upper_bound(self, max_tf: f32, idf: f32) -> f32
Upper bound with the shortest possible unit (length 0).
Trait Implementations§
Source§impl Clone for Bm25Params
impl Clone for Bm25Params
impl Copy for Bm25Params
Source§impl Debug for Bm25Params
impl Debug for Bm25Params
Source§impl Default for Bm25Params
impl Default for Bm25Params
Source§impl PartialEq for Bm25Params
impl PartialEq for Bm25Params
impl StructuralPartialEq for Bm25Params
Auto Trait Implementations§
impl Freeze for Bm25Params
impl RefUnwindSafe for Bm25Params
impl Send for Bm25Params
impl Sync for Bm25Params
impl Unpin for Bm25Params
impl UnsafeUnpin for Bm25Params
impl UnwindSafe for Bm25Params
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more