/** * Search Engine * * Main search engine that coordinates indexing, searching, and ranking. * * @since v1.68.0 */ import { type RankingConfig } from './search-ranker.js'; import type { IndexableDocument, SearchHistoryEntry, SearchIndexStats, SearchOptions, SearchResult, SearchResultType, SearchResults } from './search-types.js'; /** * Search engine configuration */ export interface SearchEngineConfig { /** Maximum results per scope */ maxResultsPerScope: number; /** Maximum total results */ maxTotalResults: number; /** Minimum score threshold */ minScoreThreshold: number; /** Enable search history */ enableHistory: boolean; /** Maximum history entries */ maxHistoryEntries: number; /** Ranking configuration */ ranking?: Partial; } /** * Default search engine configuration */ export declare const DEFAULT_SEARCH_CONFIG: SearchEngineConfig; /** * Universal search engine */ export declare class SearchEngine { private index; private config; private history; private rankingContext; constructor(config?: Partial); /** * Add a document to the search index */ addDocument(doc: IndexableDocument): void; /** * Add multiple documents to the index */ addDocuments(docs: IndexableDocument[]): void; /** * Remove a document from the index */ removeDocument(id: string): boolean; /** * Update a document in the index */ updateDocument(doc: IndexableDocument): void; /** * Check if a document exists */ hasDocument(id: string): boolean; /** * Get a document by ID */ getDocument(id: string): IndexableDocument | undefined; /** * Search for documents */ search(options: SearchOptions): SearchResults; /** * Quick search that returns flat results */ quickSearch(query: string, limit?: number, scopes?: SearchResultType[]): SearchResult[]; /** * Get search suggestions for a prefix */ getSuggestions(prefix: string, limit?: number): string[]; /** * Get recent searches */ getRecentSearches(limit?: number): SearchHistoryEntry[]; /** * Clear search history */ clearHistory(): void; /** * Add entry to search history */ private addToHistory; /** * Get documents by type */ getDocumentsByType(type: SearchResultType): IndexableDocument[]; /** * Get index statistics */ getStats(): SearchIndexStats; /** * Clear the entire index */ clear(): void; /** * Rebuild the index */ rebuild(): void; /** * Set custom ranking boosts */ setBoosts(boosts: Map): void; /** * Update configuration */ updateConfig(config: Partial): void; } /** * Get the global search engine instance */ export declare function getSearchEngine(): SearchEngine; /** * Create a new search engine */ export declare function createSearchEngine(config?: Partial): SearchEngine; /** * Reset the global search engine instance */ export declare function resetSearchEngine(): void; //# sourceMappingURL=search-engine.d.ts.map