/** * Separates hybrid retrieval into two comparable [0,1] scales: * - **semantic**: embedding cosine mapped to a match percentage * - **structured**: BM25 / symbols / path / phrase / docs headings (non-embedding signals) * * Used for display and for default hybrid ranking (structured primary). */ import type { RankBy, SearchResult } from "../entities/searchResult"; import type { RankingWeightsConfig } from "../entities/rankingWeights"; /** Map cosine similarity [-1, 1] to [0, 1] for display / sorting. */ export declare function semanticPctFromCosine(cosine: number): number; export declare function clamp01(x: number): number; /** * Populate {@link SearchResult.semanticMatch} and {@link SearchResult.structuredMatch} * from existing module `context` and merged ranking weights. */ export declare function attachMatchScales(result: SearchResult, rw: RankingWeightsConfig): SearchResult; /** Compare results for final hybrid ordering. Default: structured → semantic → fused score. */ export declare function compareSearchResultsByRankBy(a: SearchResult, b: SearchResult, rankBy: RankBy): number;