export interface KeywordResult { cardId: string; rank: number; } /** * FTS5 operators that must be excluded to prevent query injection. * Tokens are left unquoted so the Porter stemmer can apply its stemming rules * (quoted tokens in FTS5 bypass tokenizers and do exact-match only). */ declare const FTS5_OPERATORS: Set; /** * Builds an AND query (space-separated tokens, implicit AND in FTS5). * High precision — requires all tokens to appear in a card. */ export declare function buildAndQuery(tokens: string[]): string; /** * Builds an OR query (tokens joined with OR). * High recall — any token match qualifies. */ export declare function buildOrQuery(tokens: string[]): string; /** * Sanitizes raw text into a safe FTS5 query (OR mode, for backward compat). * Used by tests and callers that explicitly want OR semantics. */ export declare function sanitizeFts5Query(raw: string): string; export { FTS5_OPERATORS }; /** * Performs full-text search against the `cards_fts` FTS5 virtual table. * * Strategy: AND-first, then OR fallback. * - AND pass: requires ALL tokens to appear in a card (high precision). * e.g. "inactive patient authorization" → only cards that mention all three. * - OR fallback: if AND returns nothing, retries with any-token match (high recall). * Prevents zero results for multi-word queries where tokens are spread across fields. * * Column weights: title(3.0), content(1.0), flow(2.0), source_repos(2.0), tags(1.5), identifiers(2.0) */ export declare function keywordSearch(query: string, limit?: number): KeywordResult[]; //# sourceMappingURL=keyword.d.ts.map