/** * searchEngine.ts * Implement search functionality over documentation */ import { DocsManager } from './docsManager.js'; import type { ParsedDoc, SearchOptions, SearchResult } from './types.js'; /** * Resolve the canonical slug for a doc: Docusaurus-style sites route by * frontmatter `id` when present, overriding the file-path-derived slug. * Returns the path unchanged for missing/non-string ids. */ export declare function resolveDocSlug(path: string, id: unknown): string; export declare class SearchEngine { private docsManager; private embeddingService; private documentIndex; private indexed; private embeddingsGenerated; /** * Initialize search engine * @param docsManager - Instance of DocsManager */ constructor(docsManager: DocsManager); /** * Index all documents for searching * Should be called after repo update */ indexDocuments(): Promise; /** * Generate embeddings for all documents * Called lazily when semantic search is first used */ generateEmbeddings(): Promise; /** * Search documents * @param query - Search query string * @param options - Search options (section filter, limit, etc.) * @returns Ranked search results */ search(query: string, options?: SearchOptions): Promise; /** * Keyword-based search */ private keywordSearch; /** * Semantic search using embeddings (hybrid with keyword search) */ private semanticSearch; /** * Score a document based on query terms */ private scoreDocument; /** * Generate context snippet showing matched text */ private generateSnippet; /** * Get document by exact path * @param path - Document path relative to content root * @returns Parsed document or null if not found */ getDocByPath(path: string): Promise; /** * Get all documents in a section */ getDocsBySection(section: string): Promise; } //# sourceMappingURL=searchEngine.d.ts.map