UNPKG

@botonic/plugin-contentful

Version:

## What Does This Plugin Do?

18 lines (17 loc) 864 B
import { CMS, Context, ContextWithLocale, PagingOptions, Text } from '../cms'; import { KeywordsOptions, MatchType, Normalizer } from '../nlp'; import { SearchResult } from './search-result'; export declare class Search { private readonly cms; private readonly normalizer; private readonly search; constructor(cms: CMS, normalizer: Normalizer, keywordsOptions?: { [locale: string]: KeywordsOptions; }); /** * It does not sort the results based on the {@link SearchResult.priority}. * @param context must contain language */ searchByKeywords(inputText: string, matchType: MatchType, context: ContextWithLocale, paging?: PagingOptions): Promise<SearchResult[]>; respondFoundContents(results: SearchResult[], confirmKeywordsFoundTextId: string, noKeywordsFoundTextId: string, context: Context): Promise<Text>; }