import type Database from 'better-sqlite3'; export interface FtsResult { id: string; name: string; normLabel: string; filePath: string | null; label: string; rank: number; /** First line of the symbol in its source file (1-based, null if unknown). */ startLine: number | null; /** Last line of the symbol in its source file (1-based, null if unknown). */ endLine: number | null; } /** * THE single conversion from FTS5's `rank` to monograph's score convention. * * SCORE CONVENTION: every score that leaves the search layer is * **higher-is-better and non-negative**. SQLite FTS5's `rank` is the opposite * (negative, and *more* negative means a *better* match), so a raw rank must * never escape this module — forwarding one into a ranker that takes maxima * lets an unrelated node sitting at 0 outrank a genuine match at -0.656. * * Maps |rank| through x/(1+x) into (0, 1): monotonically increasing, so * relative BM25 order is preserved, and bounded, so it composes with the * additive fuzzy/node-type bonuses without one term swamping the others. */ export declare function relevanceFromFtsRank(rank: number): number; /** A single node label, or any of several (e.g. every code-symbol label). */ export type LabelFilter = string | readonly string[]; /** SQL fragment + params restricting `n.label`; expects the `n` alias. */ export declare function labelClause(label: LabelFilter): { sql: string; params: string[]; }; /** * Keyword search over node names and file paths (FTS5 trigram index), best * match first. A plain-language query that matches nothing is retried on the * identifier-like words extracted from it, and a short or malformed query falls * back to a substring (LIKE) match, so a search never fails on its syntax. */ export declare function ftsSearch(db: Database.Database, query: string, limit: number, label?: LabelFilter): FtsResult[]; //# sourceMappingURL=fts-store-search.d.ts.map