UNPKG

search-client

Version:

Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.

41 lines (40 loc) 2.34 kB
import { AuthToken } from '../Authentication'; import { BaseCall, DateSpecification, Fetch, Filter, IQuery, OrderBy, SearchType } from '../Common'; import { IMatches } from '../Data'; import { IFindSettings } from './FindSettings'; /** * The Find service queries the search-engine for search-matches for the given query. * * It is normally used indirectly via the SearchClient class. */ export declare class Find extends BaseCall<IMatches> { settings: IFindSettings; private queryConverter; /** * Creates a Find instance that handles fetching matches dependent on settings and query. * @param settings - The settings that define how the Find instance is to operate. * @param auth - An auth-object that handles the authentication. */ constructor(settings: IFindSettings | string, auth?: AuthToken, fetchMethod?: Fetch); clientIdChanged(oldValue: string, query: IQuery): void; dateFromChanged(oldValue: DateSpecification, query: IQuery): void; dateToChanged(oldValue: DateSpecification, query: IQuery): void; filtersChanged(oldValue: Filter[], query: IQuery): void; matchGenerateContentChanged(oldValue: boolean, query: IQuery): void; matchGenerateContentHighlightsChanged(oldValue: boolean, query: IQuery): void; matchGroupingChanged(oldValue: boolean, query: IQuery): void; matchOrderByChanged(oldValue: OrderBy, query: IQuery): void; matchPageChanged(oldValue: number, query: IQuery): void; matchPageSizeChanged(oldValue: number, query: IQuery): void; queryTextChanged(oldValue: string, query: IQuery): void; searchTypeChanged(oldValue: SearchType, query: IQuery): void; uiLanguageCodeChanged(oldValue: string, query: IQuery): void; /** * Fetches the search-result matches from the server. * Note that if a request callback has been setup then if it returns false the request is skipped. * @param query - The query-object that controls which results that are to be returned. * @param suppressCallbacks - Set to true if you have defined callbacks, but somehow don't want them to be called. * @returns a Promise that when resolved returns a string array of suggestions (or undefined if a callback stops the request). */ protected fetchInternal(query?: IQuery, suppressCallbacks?: boolean): Promise<IMatches>; }