/** * 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 * `cgdb-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[]; /** False when results came from the bounded fallback scan instead of FTS. */ ftsUsed?: boolean; } /** * FTS table set served by `searchFTSFromCgdb`. Centralised so that both * the CLI/pipeline path and the MCP pool path stay in lockstep. * * The properties list is computed at FTS-create time via `ftsPropertiesFor` * — for repos that were analysed with `--compress brotli|zstd`, the * `content` column holds base64-of-encoded-bytes and would tokenise to * useless tokens. Those repos get name-only FTS so search at least * matches function/class names instead of returning random hits on * base64 alphabet. Plain (compress='none' / unset) repos get the full * `name + content` index for body-text matches. RFC 0001 Phase 2.5. */ export declare const FTS_TABLES: ReadonlyArray<{ table: string; indexName: string; }>; export declare const ftsPropertiesFor: (compress: "none" | "brotli" | "zstd" | undefined) => readonly string[]; /** * 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 searchFTSFromCgdb: (query: string, limit?: number, repoId?: string) => Promise;