[][src]Trait tantivy::query::Scorer

pub trait Scorer: Downcast + DocSet + 'static {
    fn score(&mut self) -> Score;

    fn for_each(&mut self, callback: &mut dyn FnMut(DocId, Score)) { ... }
}

Scored set of documents matching a query within a specific segment.

See Query.

Required methods

fn score(&mut self) -> Score

Returns the score.

This method will perform a bit of computation and is not cached.

Loading content...

Provided methods

fn for_each(&mut self, callback: &mut dyn FnMut(DocId, Score))

Iterates through all of the document matched by the DocSet DocSet and push the scored documents to the collector.

Loading content...

Methods

impl dyn Scorer

pub fn is<__T: Scorer>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Scorer>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_rc<__T: Scorer>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn't.

pub fn downcast_ref<__T: Scorer>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Scorer>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementations on Foreign Types

impl Scorer for Box<dyn Scorer>[src]

Loading content...

Implementors

impl Scorer for AllScorer[src]

impl Scorer for EmptyScorer[src]

impl<TDocSet: DocSet + 'static> Scorer for ConstScorer<TDocSet>[src]

impl<TReqScorer, TOptScorer, TScoreCombiner> Scorer for RequiredOptionalScorer<TReqScorer, TOptScorer, TScoreCombiner> where
    TReqScorer: Scorer,
    TOptScorer: Scorer,
    TScoreCombiner: ScoreCombiner, 
[src]

impl<TScorer, TDocSetExclude> Scorer for Exclude<TScorer, TDocSetExclude> where
    TScorer: Scorer,
    TDocSetExclude: DocSet + 'static, 
[src]

impl<TScorer, TOtherScorer> Scorer for Intersection<TScorer, TOtherScorer> where
    TScorer: Scorer,
    TOtherScorer: Scorer
[src]

impl<TScorer, TScoreCombiner> Scorer for Union<TScorer, TScoreCombiner> where
    TScoreCombiner: ScoreCombiner,
    TScorer: Scorer
[src]

Loading content...