pub struct RegistryIndex {
pub skill: Vec<IndexedSkill>,
pub source: Vec<IndexSource>,
}Fields§
§skill: Vec<IndexedSkill>§source: Vec<IndexSource>Implementations§
Source§impl RegistryIndex
impl RegistryIndex
pub fn validate(&self) -> Result<()>
Sourcepub fn search(&self, query: &str) -> Vec<(&IndexedSkill, f64)>
pub fn search(&self, query: &str) -> Vec<(&IndexedSkill, f64)>
Scores and ranks skills against a whitespace-separated query.
Every term must match somewhere in a skill (name, namespace,
description, or tags) for the skill to be included at all —
same AND semantics as before. Where a term matched affects
ranking (a hit in the name or tags counts for much more than
a hit buried in the description), and so does how common
the term is across the whole index: a generic word that shows
up in most skills’ descriptions (e.g. “deploy”) contributes
far less to the score than a term that’s genuinely
distinctive, via a BM25-style inverse-document-frequency
weight computed per query. This keeps a broad, common query
term from single-handedly promoting every skill that happens
to mention it once in passing. Results are sorted
best-match-first (ties broken alphabetically by
qualified_name() for stable output).
Trait Implementations§
Source§impl Clone for RegistryIndex
impl Clone for RegistryIndex
Source§fn clone(&self) -> RegistryIndex
fn clone(&self) -> RegistryIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more