@microsearch/lightning
Version:
Lightning fast text search for Node.js - blazing fast markdown and text search engine ⚡
23 lines (22 loc) • 604 B
TypeScript
import { clearIndex } from './indexing.js';
export interface SearchDocument {
id: string | number;
title: string;
content: string;
path?: string;
[key: string]: unknown;
}
export interface SearchResult {
docId: string | number;
title: string;
path: string;
snippet: string;
score: number;
}
export interface SearchOptions {
limit?: number;
fields?: string[];
}
export declare function addDocumentsFromPath(path: string): Promise<void>;
export declare function search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
export { clearIndex };