1
0
silverbullet/plug-api/plugos-syscall/fulltext.ts

25 lines
568 B
TypeScript
Raw Normal View History

import { syscall } from "./syscall.ts";
export function fullTextIndex(key: string, value: string) {
return syscall("fulltext.index", key, value);
}
export function fullTextDelete(key: string) {
return syscall("fulltext.delete", key);
}
2022-10-22 18:23:54 +00:00
export type FullTextSearchOptions = {
limit?: number;
highlightPrefix?: string;
highlightPostfix?: string;
highlightEllipsis?: string;
summaryMaxLength?: number;
};
export function fullTextSearch(
phrase: string,
options: FullTextSearchOptions = {},
) {
return syscall("fulltext.search", phrase, options);
}