pub struct RetrievalQuery {
pub text: String,
pub architecture: Option<ArchitectureFingerprint>,
pub now: DateTime<Utc>,
pub half_life_days: f64,
pub embedding: Option<(String, Vec<f32>)>,
pub limit: usize,
pub research_line: Option<String>,
pub tags: Vec<String>,
}Expand description
What to retrieve, and what to measure it against.
Fields§
§text: StringFree text. Empty is allowed: the other three terms still rank.
architecture: Option<ArchitectureFingerprint>Architecture to compare against, when the caller has one.
now: DateTime<Utc>Reference time for recency. A parameter, not Utc::now(), so
ranking is reproducible.
half_life_days: f64Recency half-life in days; DEFAULT_HALF_LIFE_DAYS unless set.
embedding: Option<(String, Vec<f32>)>Query vector, from the same embedder that produced the records’. When present, it blends into the lexical term for records carrying a vector from the same model.
limit: usizeMaximum number of results returned.
research_line: Option<String>Restrict to one research line.
Every listed tag must be present.
Implementations§
Source§impl RetrievalQuery
impl RetrievalQuery
Sourcepub fn new(text: impl Into<String>, now: DateTime<Utc>) -> Self
pub fn new(text: impl Into<String>, now: DateTime<Utc>) -> Self
A text query against now, with the default half-life.
Sourcepub fn with_architecture(self, architecture: ArchitectureFingerprint) -> Self
pub fn with_architecture(self, architecture: ArchitectureFingerprint) -> Self
Compare candidates structurally against this fingerprint, activating the structural term.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Cap the number of results.
Sourcepub fn in_line(self, line: impl Into<String>) -> Self
pub fn in_line(self, line: impl Into<String>) -> Self
Restrict candidates to one research line, before scoring.
Require every listed tag on a candidate, before scoring.
Trait Implementations§
Source§impl Clone for RetrievalQuery
impl Clone for RetrievalQuery
Source§fn clone(&self) -> RetrievalQuery
fn clone(&self) -> RetrievalQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more