/** * FlexSearch implementation of SearchEngineAdapter * High-performance full-text search library */ import { SearchableDocument, SearchResult, SearchOptions } from '../../types'; import { SearchEngineAdapter, SearchEngineOptions } from '../types'; interface FlexSearchOptions extends SearchEngineOptions { preset?: 'memory' | 'performance' | 'match' | 'score' | 'default'; tokenize?: 'strict' | 'forward' | 'reverse' | 'full'; resolution?: number; context?: boolean | { depth: number; bidirectional: boolean; resolution: number; }; optimize?: boolean; boost?: (search: { field: string; query: string; match: string; }) => number; } export declare class FlexSearchAdapter implements SearchEngineAdapter { private index; private documents; private options; private indexCleared; private sessionId; constructor(options?: FlexSearchOptions); initialize(options?: SearchEngineOptions): Promise; addDocuments(documents: SearchableDocument[]): Promise; removeDocuments(ids: string[]): Promise; search(query: string, options?: SearchOptions): Promise; exportIndex(): Promise; importIndex(data: unknown): Promise; clear(): Promise; /** * Start a new indexing session - resets the indexCleared flag * This should be called before starting a new batch of addDocuments calls */ startNewIndexingSession(): void; /** * Get all documents from the index */ getAllDocuments(): Promise; /** * Create match information for a query in content */ private createMatchInfo; /** * Create match context with before/after text */ private createMatchContext; /** * Create highlighted content snippet * TODO: This needs to be reimplemented to work with on-demand content loading. * Options: * 1. Load snippet from file around match position * 2. Store small context windows during indexing * 3. Use FlexSearch's built-in context feature * For now, returning empty string to avoid memory issues. */ private createHighlights; /** * Type guard for import data */ private isValidImportData; } export {}; //# sourceMappingURL=FlexSearchAdapter.d.ts.map