Enum tantivy::query::EnableScoring
source · pub enum EnableScoring<'a> {
Enabled {
searcher: &'a Searcher,
statistics_provider: &'a dyn Bm25StatisticsProvider,
},
Disabled {
schema: &'a Schema,
searcher_opt: Option<&'a Searcher>,
},
}
Expand description
Argument used in Query::weight(..)
Variants§
Enabled
Pass this to enable scoring.
Fields
§
statistics_provider: &'a dyn Bm25StatisticsProvider
A Bm25StatisticsProvider used to compute BM25 scores.
Normally this should be the Searcher, but you can specify a custom one to adjust the statistics.
Disabled
Pass this to disable scoring. This can improve performance.
Implementations§
source§impl<'a> EnableScoring<'a>
impl<'a> EnableScoring<'a>
sourcepub fn enabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>
pub fn enabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>
Create using Searcher with scoring enabled.
sourcepub fn enabled_from_statistics_provider(
statistics_provider: &'a dyn Bm25StatisticsProvider,
searcher: &'a Searcher
) -> EnableScoring<'a>
pub fn enabled_from_statistics_provider( statistics_provider: &'a dyn Bm25StatisticsProvider, searcher: &'a Searcher ) -> EnableScoring<'a>
Create using a custom Bm25StatisticsProvider with scoring enabled.
sourcepub fn disabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>
pub fn disabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>
Create using Searcher with scoring disabled.
sourcepub fn disabled_from_schema(schema: &'a Schema) -> EnableScoring<'a>
pub fn disabled_from_schema(schema: &'a Schema) -> EnableScoring<'a>
Create using Schema with scoring disabled.
sourcepub fn is_scoring_enabled(&self) -> bool
pub fn is_scoring_enabled(&self) -> bool
Returns true if the scoring is enabled.
Trait Implementations§
source§impl<'a> Clone for EnableScoring<'a>
impl<'a> Clone for EnableScoring<'a>
source§fn clone(&self) -> EnableScoring<'a>
fn clone(&self) -> EnableScoring<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<'a> Copy for EnableScoring<'a>
Auto Trait Implementations§
impl<'a> Freeze for EnableScoring<'a>
impl<'a> !RefUnwindSafe for EnableScoring<'a>
impl<'a> !Send for EnableScoring<'a>
impl<'a> !Sync for EnableScoring<'a>
impl<'a> Unpin for EnableScoring<'a>
impl<'a> !UnwindSafe for EnableScoring<'a>
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.