# Class SearchEndpoint

## Index

### Methods

- deleteSubscription
- extensions
- facetSearch
- fetchBinary
- follow
- getAuthenticationProviderUri
- getBaseAlertsUri
- getBaseUri
- getDocument
- getDocumentHtml
- getDocumentText
- getExportToExcelLink
- getQuerySuggest
- getRawDataStream
- getViewAsDatastreamUri
- getViewAsHtmlUri
- isJsonp
- listFieldValues
- listFieldValuesBatch
- listFields
- listSubscriptions
- plan
- rateDocument
- search
- setRequestModifier
- tagDocument
- updateSubscription
- configureCloudEndpoint
- configureCloudV2Endpoint
- configureOnPremiseEndpoint
- configureSampleEndpoint
- configureSampleEndpointV2

### Properties

- endpoints

### Constructors

- constructor

## Methods

### deleteSubscription

- deleteSubscription(subscription: ISubscription, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ISubscription>

- - Defined in rest/SearchEndpoint.ts :1024

  #### Parameters

  - ##### subscription: ISubscription

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ISubscription>

### extensions

- extensions(callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IExtension[]>

- - Defined in rest/SearchEndpoint.ts :763

  #### Parameters

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IExtension[]>

  A Promise of the extensions.

### facetSearch

- facetSearch(request: IFacetSearchRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IFacetSearchResponse>

- - Defined in rest/SearchEndpoint.ts :882

  #### Parameters

  - ##### request: IFacetSearchRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IFacetSearchResponse>

  A Promise of facet search results.

### fetchBinary

- fetchBinary(query: IQuery, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ArrayBuffer>

- - Defined in rest/SearchEndpoint.ts :414

  #### Parameters

  - ##### query: IQuery

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ArrayBuffer>

  A Promise of query results.

### follow

- follow(request: ISubscriptionRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ISubscription>

- - Defined in rest/SearchEndpoint.ts :907

  #### Parameters

  - ##### request: ISubscriptionRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ISubscription>

### getAuthenticationProviderUri

- getAuthenticationProviderUri(provider: string, returnUri?: string, message?: string, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): string

- - Defined in rest/SearchEndpoint.ts :309

  #### Parameters

  - ##### provider: string

  - ##### Optional returnUri: string

  - ##### Optional message: string

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns string

  The authentication provider URI.

### getBaseAlertsUri

- getBaseAlertsUri(): string

- - Defined in rest/SearchEndpoint.ts :294

  #### Returns string

  The base URI of the search alerts endpoint.

### getBaseUri

- getBaseUri(): string

- - Defined in rest/SearchEndpoint.ts :286

  #### Returns string

  The base URI of the Search API endpoint.

### getDocument

- getDocument(documentUniqueID: string, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IQueryResult>

- - Defined in rest/SearchEndpoint.ts :561

  #### Parameters

  - ##### documentUniqueID: string

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IQueryResult>

  A Promise of the item.

### getDocumentHtml

- getDocumentHtml(documentUniqueID: string, callOptions?: IViewAsHtmlOptions, callParams?: IEndpointCallParameters): Promise<HTMLDocument>

- - Defined in rest/SearchEndpoint.ts :622

  #### Parameters

  - ##### documentUniqueID: string

  - ##### Optional callOptions: IViewAsHtmlOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<HTMLDocument>

  A Promise of the item content.

### getDocumentText

- getDocumentText(documentUniqueID: string, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<string>

- - Defined in rest/SearchEndpoint.ts :592

  #### Parameters

  - ##### documentUniqueID: string

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<string>

  A Promise of the item content.

### getExportToExcelLink

- getExportToExcelLink(query: IQuery, numberOfResults: number, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): string

- - Defined in rest/SearchEndpoint.ts :460

  #### Parameters

  - ##### query: IQuery

  - ##### numberOfResults: number

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns string

  The download URI.

### getQuerySuggest

- getQuerySuggest(request: IQuerySuggestRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IQuerySuggestResponse>

- - Defined in rest/SearchEndpoint.ts :847

  #### Parameters

  - ##### request: IQuerySuggestRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IQuerySuggestResponse>

  A Promise of query suggestions.

### getRawDataStream

- getRawDataStream(documentUniqueId: string, dataStreamType: string, callOptions?: IViewAsHtmlOptions, callParams?: IEndpointCallParameters): Promise<ArrayBuffer>

- - Defined in rest/SearchEndpoint.ts :498

  #### Parameters

  - ##### documentUniqueId: string

  - ##### dataStreamType: string

  - ##### Optional callOptions: IViewAsHtmlOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ArrayBuffer>

### getViewAsDatastreamUri

- getViewAsDatastreamUri(documentUniqueID: string, dataStreamType: string, callOptions?: IViewAsHtmlOptions, callParams?: IEndpointCallParameters): string

- - Defined in rest/SearchEndpoint.ts :533

  #### Parameters

  - ##### documentUniqueID: string

  - ##### dataStreamType: string

  - ##### Default value callOptions: IViewAsHtmlOptions = {}

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns string

  The datastream URL.

### getViewAsHtmlUri

- getViewAsHtmlUri(documentUniqueID: string, callOptions?: IViewAsHtmlOptions, callParams?: IEndpointCallParameters): string

- - Defined in rest/SearchEndpoint.ts :659

  #### Parameters

  - ##### documentUniqueID: string

  - ##### Optional callOptions: IViewAsHtmlOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns string

  The URL.

### isJsonp

- isJsonp(): boolean

- - Defined in rest/SearchEndpoint.ts :331

  #### Returns boolean

  `true` in the search enpoint is using JSONP; `false` otherwise.

### listFieldValues

- listFieldValues(request: IListFieldValuesRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IIndexFieldValue[]>

- - Defined in rest/SearchEndpoint.ts :680

  #### Parameters

  - ##### request: IListFieldValuesRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IIndexFieldValue[]>

  A Promise of the field values.

### listFieldValuesBatch

- listFieldValuesBatch(request: IListFieldValuesBatchRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IIndexFieldValue[][]>

- - Defined in rest/SearchEndpoint.ts :713

  #### Parameters

  - ##### request: IListFieldValuesBatchRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IIndexFieldValue[][]>

  A Promise of the field values.

### listFields

- listFields(callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IFieldDescription[]>

- - Defined in rest/SearchEndpoint.ts :745

  #### Parameters

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IFieldDescription[]>

  A Promise of the index fields and descriptions.

### listSubscriptions

- listSubscriptions(page?: number, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ISubscription[]>

- - Defined in rest/SearchEndpoint.ts :936

  #### Parameters

  - ##### Optional page: number

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ISubscription[]>

### plan

- plan(query: IQuery, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ExecutionPlan>

- - Defined in rest/SearchEndpoint.ts :434

  #### Parameters

  - ##### query: IQuery

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ExecutionPlan>

  A Promise of plan results.

### rateDocument

- rateDocument(ratingRequest: IRatingRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<boolean>

- - Defined in rest/SearchEndpoint.ts :786

  #### Parameters

  - ##### ratingRequest: IRatingRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<boolean>

### search

- search(query: IQuery, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<IQueryResults>

- - Defined in rest/SearchEndpoint.ts :367

  #### Parameters

  - ##### query: IQuery

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<IQueryResults>

  A Promise of query results.

### setRequestModifier

- setRequestModifier(requestModifier: function): void

- - Defined in rest/SearchEndpoint.ts :278

  #### Parameters

  - ##### requestModifier: function

    - - (params: IRequestInfo<any>): IRequestInfo<any>

      - #### Parameters

        - ##### params: IRequestInfo<any>

        #### Returns IRequestInfo<any>

  #### Returns void

### tagDocument

- tagDocument(taggingRequest: ITaggingRequest, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<boolean>

- - Defined in rest/SearchEndpoint.ts :816

  #### Parameters

  - ##### taggingRequest: ITaggingRequest

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<boolean>

### updateSubscription

- updateSubscription(subscription: ISubscription, callOptions?: IEndpointCallOptions, callParams?: IEndpointCallParameters): Promise<ISubscription>

- - Defined in rest/SearchEndpoint.ts :987

  #### Parameters

  - ##### subscription: ISubscription

  - ##### Optional callOptions: IEndpointCallOptions

  - ##### Optional callParams: IEndpointCallParameters

  #### Returns Promise<ISubscription>

### Static configureCloudEndpoint

- configureCloudEndpoint(organization?: string, token?: string, uri?: string, otherOptions?: ISearchEndpointOptions): void

- - Defined in rest/SearchEndpoint.ts :143

  #### Parameters

  - ##### Optional organization: string

  - ##### Optional token: string

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

  - ##### Optional otherOptions: ISearchEndpointOptions

  #### Returns void

### Static configureCloudV2Endpoint

- configureCloudV2Endpoint(organization?: string, token?: string, uri?: string, otherOptions?: ISearchEndpointOptions): void

- - Defined in rest/SearchEndpoint.ts :178

  #### Parameters

  - ##### Optional organization: string

  - ##### Optional token: string

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

  - ##### Optional otherOptions: ISearchEndpointOptions

  #### Returns void

### Static configureOnPremiseEndpoint

- configureOnPremiseEndpoint(uri: string, token?: string, otherOptions?: ISearchEndpointOptions): void

- - Defined in rest/SearchEndpoint.ts :194

  #### Parameters

  - ##### uri: string

  - ##### Optional token: string

  - ##### Optional otherOptions: ISearchEndpointOptions

  #### Returns void

### Static configureSampleEndpoint

- configureSampleEndpoint(otherOptions?: ISearchEndpointOptions): void

- - Defined in rest/SearchEndpoint.ts :86

  #### Parameters

  - ##### Optional otherOptions: ISearchEndpointOptions

  #### Returns void

### Static configureSampleEndpointV2

- configureSampleEndpointV2(otherOptions?: ISearchEndpointOptions): void

- - Defined in rest/SearchEndpoint.ts :120

  #### Parameters

  - ##### Optional otherOptions: ISearchEndpointOptions

  #### Returns void

## Properties

### Static endpoints

endpoints: object

- Defined in rest/SearchEndpoint.ts :77

#### Type declaration

- ##### [endpoint: string]: SearchEndpoint

## Constructors

### constructor

- new SearchEndpoint(options?: ISearchEndpointOptions): SearchEndpoint

- - Defined in rest/SearchEndpoint.ts :230

  #### Parameters

  - ##### Optional options: ISearchEndpointOptions

  #### Returns SearchEndpoint

### Hierarchy

- SearchEndpoint

### Implements

- ISearchEndpoint