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

§searcher: &'a Searcher

The searcher to use during scoring.

§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.

Fields

§schema: &'a Schema

Schema is required.

§searcher_opt: Option<&'a Searcher>

Searcher should be provided if available.

Implementations§

source§

impl<'a> EnableScoring<'a>

source

pub fn enabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>

Create using Searcher with scoring enabled.

source

pub fn enabled_from_statistics_provider( statistics_provider: &'a dyn Bm25StatisticsProvider, searcher: &'a Searcher ) -> EnableScoring<'a>

Create using a custom Bm25StatisticsProvider with scoring enabled.

source

pub fn disabled_from_searcher(searcher: &'a Searcher) -> EnableScoring<'a>

Create using Searcher with scoring disabled.

source

pub fn disabled_from_schema(schema: &'a Schema) -> EnableScoring<'a>

Create using Schema with scoring disabled.

source

pub fn searcher(&self) -> Option<&Searcher>

Returns the searcher if available.

source

pub fn schema(&self) -> &Schema

Returns the schema.

source

pub fn is_scoring_enabled(&self) -> bool

Returns true if the scoring is enabled.

Trait Implementations§

source§

impl<'a> Clone for EnableScoring<'a>

source§

fn clone(&self) -> EnableScoring<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.