/** * @nahisaho/yata-scale - Full-Text Index * * Full-text search index with tokenization and ranking */ import type { IndexStats } from '../types.js'; /** * Document to index */ export interface IndexDocument { readonly id: string; readonly content: string; readonly boost?: number; } /** * Search result */ export interface SearchResult { readonly id: string; readonly score: number; readonly highlights?: string[]; } /** * Full-text search index with BM25 ranking */ export declare class FullTextIndex { private invertedIndex; private documentLengths; private documentCount; private totalLength; private readonly k1; private readonly b; constructor(); /** * Index a document */ index(doc: IndexDocument): void; /** * Remove a document from index */ removeDocument(id: string): boolean; /** * Search for documents */ search(query: string, limit?: number): SearchResult[]; /** * Fuzzy search using Levenshtein distance */ fuzzySearch(query: string, maxDistance?: number, limit?: number): SearchResult[]; /** * Tokenize text */ private tokenize; /** * Simple stemmer (Porter-like for English) */ private stem; /** * Calculate term frequencies */ private calculateTermFrequencies; /** * Levenshtein distance for fuzzy matching */ private levenshteinDistance; /** * Clear the index */ clear(): void; /** * Get document count */ get size(): number; /** * Get term count */ get termCount(): number; /** * Get index statistics */ getStats(): IndexStats; /** * Estimate memory size */ private estimateSize; } //# sourceMappingURL=FullTextIndex.d.ts.map