Use the Sitecore LinkManager to resolve URIs

Warning
Legacy feature

This article pertains to the Coveo Hive framework which is now in maintenance mode.

Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details.

This page explains how to use the Sitecore LinkManager to resolve search result URIs in a Coveo-powered search page.

What’s the LinkManager

The LinkManager is a module of Sitecore used to resolve URIs. For example, you may only want to display relative URIs, or add the current item language to its URI. The LinkManager is particularly useful in a multi-site configuration, where an item can be accessed via different URIs that seem completely unrelated to each other.

For example, if, in your Content Tree, under the Content node, you have the following structure:

32604743

And if your Sites node in your <SITECORE_INSTANCE_ROOT>\App_Config\Sitecore.config file looks like this:

<site name="mysite1" hostName="www.mysite1.ca" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/mysite1" language="en" database="web" domain="extranet" enableWebEdit="true" />
<site name="mysite2" hostName="www.mysite2.ca" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/mysite2" language="en" database="web" domain="extranet" enableWebEdit="true" />

Given the above configuration, the required IIS bindings, and a properly configured hosts file, it’s possible to access the page1 item via the URI www.mysite1.ca/page1 and the page2 item via the URI www.mysite2.ca/page2. This would also allow you to access the page2 item with the following URI: www.mysite1.ca/mysite2/page2.

The ResolveResultClickableUriProcessor

On a Coveo-powered search page, the Sitecore LinkManager configures your URIs. This configuration is allowed through the ResolveResultClickableUriProcessor processor, which you can find in your <SITECORE_INSTANCE_ROOT>\App_Config\Modules\Coveo\Coveo.SearchProvider.Rest.config file.

Important

Don’t modify the Coveo.SearchProvider.Rest.config file directly. You should instead implement your modifications in the <SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveo\Coveo.SearchProvider.Rest.Custom.config file, to prevent unforeseen upgrade issues.

<coveoProcessParsedRestResponse>
  <processor type="Coveo.SearchProvider.Rest.Processors.CoveoProcessParsedRestResponse.ResolveResultClickableUriProcessor, Coveo.SearchProvider.Rest" />
</coveoProcessParsedRestResponse>
Note

This processor uses the following fields: syssource and uri. If you plan on removing one of these fields, insert your processor after this one.

Configuring the LinkManager

  1. Configure the <sites> node of the Sitecore configuration (see Configure multiple managed websites).

  2. Change the Sitecore site resolving settings, if necessary. Look for the nodes named Rendering.SiteResolving, Rendering.SiteResolvingMatchCurrentLanguage, and Rendering.SiteResolvingMatchCurrentSite in the <settings> node of the Sitecore configuration. Explanations for each setting are provided in the configuration file.

  3. Configure the format of URIs that are to be resolved in the <linkManager> section of the Sitecore.config file.