Skip to main content

apply_structural_boost

Function apply_structural_boost 

Source
pub fn apply_structural_boost<S: BuildHasher>(
    results: &mut [SearchResult],
    file_ranks: &HashMap<String, f32, S>,
    alpha: f32,
)
Expand description

Normalize similarity scores to [0,1] and apply a PageRank structural boost.

Each result’s similarity is min-max normalized, then a weighted PageRank score is added: final = normalized + alpha * pagerank. This promotes architecturally important files (many dependents) in search results.

Called from the MCP search handler which has access to the RepoGraph, rather than from search directly.