Support Menu

Class SearchEndpoint

A search endpoint allows to execute various actions against the Coveo Search API and index.
For example, you can search, list field values, get the quickview content for a document, etc.
Any actions that you execute using this class will not trigger a full query cycle for the Coveo components.
This is because this class will not trigger any query events directly.
If you wish to execute a query that all components will react to (and trigger the corresponding query events), use the QueryController

Index

Methods

deleteSubscription

extensions

follow

getAuthenticationProviderUri

  • Get the uri that can be used to authenticate against the given provider

    Parameters

    • provider: string

      The provider name

    • Optional returnUri: string

      The uri at which to return after the authentication is completed

    • Optional message: string

      The message for authentication

    • Optional callOptions: IEndpointCallOptions

      Additional set of options to use for this call.

    • Optional callParams: IEndpointCallParameters

      Options injected by the applied decorators.

    Returns string

getBaseAlertsUri

  • getBaseAlertsUri(): string

getBaseUri

  • getBaseUri(): string

getDocument

getDocumentHtml

getDocumentText

getExportToExcelLink

  • Get a link/uri to download a set of results, for a given query, to an xlsx format.
    Note : This does not download automatically the documents, merely provide an url at which to download them.

    Parameters

    • query: IQuery

      The query for which to get the xlsx documents

    • numberOfResults: number

      The number of results that should be downloaded

    • Optional callOptions: IEndpointCallOptions

      Additional set of options to use for this call.

    • Optional callParams: IEndpointCallParameters

      Options injected by the applied decorators.

    Returns string

getRawDataStream

  • Get the raw datastream for a given document. This is typically used to get a thumbnail for a document.
    Return an array buffer :
    eg : let rawBinary = String.fromCharCode.apply(null, new Uint8Array(response));
    img.setAttribute('src', 'data:image/png;base64,' + btoa(rawBinary));

    Parameters

    Returns Promise<ArrayBuffer>

getRevealQuerySuggest

getViewAsDatastreamUri

  • Return an url that will allow to see the datastream for a given document. This is typically used to get a thumbnail for a document.

    Parameters

    Returns string

getViewAsHtmlUri

isJsonp

  • isJsonp(): boolean

listFieldValues

listFields

listSubscriptions

rateDocument

search

setRequestModifier

  • setRequestModifier(requestModifier: function): void
  • Set a function which will allow external code to modify all endpoint call parameters before they are sent by the browser.

    Used in very specific scenario where the network infrastructure require special request headers to be added or removed, for example.

    Parameters

    Returns void

tagDocument

updateSubscription

Static configureCloudEndpoint

  • configureCloudEndpoint(organization?: string, token?: string, uri?: string, otherOptions?: ISearchEndpointOptions): void
  • Configure an endpoint to a Coveo Cloud index.

    Parameters

    • Optional organization: string

      The organization id of your Coveo cloud index

    • Optional token: string

      The token to use to execute query. If null, you will most probably need to login when querying.

    • Default value uri: string = "https://cloudplatform.coveo.com/rest/search"

      The uri of your cloud Search API. By default, will point to the production environment

    • Optional otherOptions: ISearchEndpointOptions

      A set of additional options to use when configuring this endpoint

    Returns void

Static configureCloudV2Endpoint

  • configureCloudV2Endpoint(organization?: string, token?: string, uri?: string, otherOptions?: ISearchEndpointOptions): void
  • Configure an endpoint to a Coveo Cloud index, in the V2 platform.

    Parameters

    • Optional organization: string

      The organization id of your Coveo cloud index

    • Optional token: string

      The token to use to execute query. If null, you will most probably need to login when querying.

    • Default value uri: string = "https://platform.cloud.coveo.com/rest/search"

      The uri of your cloud Search API. By default, will point to the production environment

    • Optional otherOptions: ISearchEndpointOptions

      A set of additional options to use when configuring this endpoint

    Returns void

Static configureOnPremiseEndpoint

  • Configure an endpoint to a Coveo on premise index.

    Parameters

    • uri: string

      The uri of your Coveo Search API endpoint. eg : http://myserver:8080/rest/search

    • Optional token: string

      The token to use to execute query. If null, you will most probably need to login when querying (unless the search api is configured using advanced auth options, like windows auth or claims)

    • Optional otherOptions: ISearchEndpointOptions

      A set of additional options to use when configuring this endpoint

    Returns void

Static configureSampleEndpoint

  • Configure an endpoint that will point to a Coveo Cloud index, which contains a set of public sources with no security on them.
    Used for demo purposes and ease of setup.

    Parameters

    • Optional otherOptions: ISearchEndpointOptions

      A set of additional options to use when configuring this endpoint

    Returns void

Static configureSampleEndpointV2

  • Configure an endpoint that will point to a Coveo Cloud index V2, which contains a set of public sources with no security on them.
    Used for demo purposes and ease of setup.

    Parameters

    Returns void

Properties

Static endpoints

endpoints: object

A map of all the initialized endpoint.
eg : Coveo.SearchEndpoint.endpoints['default'] will return the default endpoint that was created at initialization

type

{{}}

Type declaration

Constructors

constructor

Hierarchy

  • SearchEndpoint

Implements

  • ISearchEndpoint