UNPKG

coveo-search-ui

Version:

Coveo JavaScript Search Framework

114 lines (97 loc) 3.36 kB
import { IStringMap } from './GenericParam'; /** * The IQuerySuggestCompletion interface describes a completion suggestion from the Coveo Machine Learning * service (see [Coveo Machine Learning](https://docs.coveo.com/en/1727/). */ export interface IQuerySuggestCompletion { /** * Contains the expression to complete. */ expression: string; /** * Contains a value indicating how certain the Coveo Machine Learning service is that this suggestion is actually * relevant. */ score: number; /** * Contains the highlighted expression to complete. */ highlighted: string; /** * Contains a value indicating the confidence level that this suggestion should be executed. */ executableConfidence: number; } /** * The IQuerySuggestResponse interface describes a response from the Coveo Machine Learning service query * suggestions. */ export interface IQuerySuggestResponse { /** * Contains an array of completions. */ completions: IQuerySuggestCompletion[]; } /** * The IQuerySuggestRequest interface describes a request to the Coveo Machine Learning service query suggest. */ export interface IQuerySuggestRequest { /** * Specifies the query / word for which to get completion. */ q: string; /** * Specifies the search hub for which to get suggestions. */ searchHub?: string; /** * Specifies the number of suggestions that the Coveo Machine Learning service should return. * * Default value is `5`. */ count?: number; /** * Specifies the pipeline to use for the request. */ pipeline?: string; /** * Specifies the context to use for the request. */ context?: IStringMap<any>; /** * Specifies the second level of origin of the request, typically the identifier of the selected tab from which the request originates. */ tab?: string; /** * Specifies the third level of origin of the request, typically the URL of the page that linked to the search interface from which the request originates (e.g., in JavaScript, this would correspond to the `document.referrer` value). */ referrer?: string; /** * The locale of the current user. Will typically match the "language" parameter that is used to perform standard queries. */ locale?: string; /** * Specifies whether to attempt to complete the last word of the current "q" parameter and boost the ranking score of the resulting expression so that it is returned as the first query suggestion. */ enableWordCompletion?: boolean; /** * Specfies the actions history which represents the past actions a user made. It is generated by the page view script (https://github.com/coveo/coveo.analytics.js) */ actionsHistory?: any[]; /** * The tz database identifier of the time zone to use to correctly interpret dates in the query expression and result items. */ timezone?: string; /** * A GUID representing the current user, who can be authenticated or anonymous. This GUID is normally generated by the usage analytics service and stored in a non-expiring browser cookie. * @deprecated */ visitorId?: string; /** * Whether the current user is anonymous. This can be specified when configuring the {@link SearchEndpoint}. */ isGuestUser?: boolean; autoCompleter?: string; additionalData?: any; format?: string; }