Skip to main content

RecencyPolicy

Trait RecencyPolicy 

Source
pub trait RecencyPolicy: Send + Sync {
    // Required method
    fn factor(&self, fact: &RecencyContext) -> f64;

    // Provided method
    fn is_identity(&self) -> bool { ... }
}
Expand description

Multiplies a result’s retrieval score. Default: NoRecency, which leaves scores exactly as document search returned them.

Required Methods§

Source

fn factor(&self, fact: &RecencyContext) -> f64

A finite, nonnegative multiplier.

Provided Methods§

Source

fn is_identity(&self) -> bool

True when the policy never changes a score; recall then skips it and keeps the document search order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§