Use the Sitecore LinkManager to resolve URIs
Use the Sitecore LinkManager to resolve URIs
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:
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.
Don’t modify the |
<coveoProcessParsedRestResponse>
<processor type="Coveo.SearchProvider.Rest.Processors.CoveoProcessParsedRestResponse.ResolveResultClickableUriProcessor, Coveo.SearchProvider.Rest" />
</coveoProcessParsedRestResponse>
Note
This processor uses the following fields: |
Configuring the LinkManager
-
Configure the
<sites>
node of the Sitecore configuration (see Configure multiple managed websites). -
Change the Sitecore site resolving settings, if necessary. Look for the nodes named
Rendering.SiteResolving
,Rendering.SiteResolvingMatchCurrentLanguage
, andRendering.SiteResolvingMatchCurrentSite
in the<settings>
node of the Sitecore configuration. Explanations for each setting are provided in the configuration file. -
Configure the format of URIs that are to be resolved in the
<linkManager>
section of theSitecore.config
file.