/** * SMI-579: SearchService Helpers * * Helper functions for FTS5 search operations. */ import type { Skill, SearchResult } from '../types/skill.js'; import type { FTSRow } from './SearchService.types.js'; /** * Escape a single FTS token * * SMI-1034: Escape FTS5 special characters to prevent syntax errors. * FTS5 special characters include: . " ' ( ) [ ] { } * ^ - * The hyphen `-` is the NOT operator in FTS5, so it must be escaped too. * These are replaced with spaces to ensure queries don't fail. */ export declare function escapeFtsToken(token: string): string; /** * Build FTS5 query with proper escaping * * SMI-1034: Enhanced to filter empty tokens after escaping special characters. * * @param query - Raw search query * @returns Properly formatted FTS5 query string, or empty string if no valid tokens */ export declare function buildFtsQuery(query: string): string; /** * Build cache key from search options */ export declare function buildCacheKey(options: object): string; /** * Convert database row to Skill object */ export declare function rowToSkill(row: FTSRow): Skill; /** * Build highlighted snippets for matched terms */ export declare function buildHighlights(skill: Skill, query: string): SearchResult['highlights']; /** * Build a search result with highlights */ export declare function buildSearchResult(row: FTSRow, query: string): SearchResult; //# sourceMappingURL=SearchService.helpers.d.ts.map