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§
Sourcefn factor(&self, fact: &RecencyContext) -> f64
fn factor(&self, fact: &RecencyContext) -> f64
A finite, nonnegative multiplier.
Provided Methods§
Sourcefn is_identity(&self) -> bool
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".