Understanding the REST Endpoint Configuration Files

When loading a search page in a web browser, the JavaScript Search Framework components use the Coveo Search REST endpoint to perform queries. This REST endpoint is installed on the Sitecore website. This way, it can better leverage the information present in the Sitecore context.

To make this communication work, the Coveo Search REST endpoint relies on two very important components. The first one is a custom HTTP handler that’s seen as the REST endpoint itself. Its default location in the website is /coveo/rest. The second component is the Coveo Search API service, which resides in the Coveo Cloud. The Search API service is responsible for querying the search index (see Search API).

Understanding the Coveo.SearchProvider.Rest.config File

Those are the basic settings that must be configured initially. They can be found under the configuration/sitecore/coveo/restEndpointConfiguration element.

Name Description Example Value
apiKey The encrypted API key of the Cloud organization that’s being queried.  
organizationId The ID of the Cloud organization that’s being queried.  
requestTimeout The timeout period for requests going through the search API proxy. 00:00:30
restEndpointPath Defines the location of the REST endpoint in the Sitecore website. /coveo/rest
searchTokenExpiration Defines the period when the search token is valid. 01:00:00
searchApiUri The URI to connect to the Coveo Cloud Search API.  

Example Configuration

By default, the content of every node will be a reference to the cloud platform configuration node corresponding to the required value.

  <searchApiUri ref="coveo/cloudPlatformConfiguration/cloudPlatformUri" />
  <apiKey ref="coveo/cloudPlatformConfiguration/apiKey" />
  <organizationId ref="coveo/cloudPlatformConfiguration/organizationId" />
Recommended Articles