/** * Full-Text Search via LadybugDB FTS * * Uses LadybugDB's built-in full-text search indexes for keyword-based search. * Always reads from the database (no cached state to drift). * * FTS indexes are created lazily on first query (via `ensureFTSIndex`) — see * `lbug-adapter.ts` for the rationale. This keeps `analyze` fast (the * ~440 ms × 5 LadybugDB CREATE_FTS_INDEX cost dominates pipeline time on * small repos / CI runners) at the cost of paying that overhead on the * first `query`/`context` call in a session. */ export interface BM25SearchResult { filePath: string; score: number; rank: number; nodeIds?: string[]; } /** * Drop all ensured-FTS cache entries for a given repoId. * * Called from the pool-close listener so that a pool teardown / recreation * forces the next `searchFTSFromLbug` call to re-issue `CREATE_FTS_INDEX` * against the fresh connection rather than trust stale ensure-state from a * previous pool lifetime. * * Exported for tests; the listener wiring is internal. */ export declare function invalidateEnsuredFTSForRepo(repoId: string): void; /** * Search using LadybugDB's built-in FTS (always fresh, reads from disk) * * Queries multiple node tables (File, Function, Class, Method) in parallel * and merges results by filePath, summing scores for the same file. * * @param query - Search query string * @param limit - Maximum results * @param repoId - If provided, queries will be routed via the MCP connection pool * @returns Ranked search results from FTS indexes */ export declare const searchFTSFromLbug: (query: string, limit?: number, repoId?: string) => Promise;