Urls on multi-site sitecore solution
The urls in Coveo for the second site are not working correctly.
These are the sites…
<site name="demo" inherits="sitebase" hostName="site1.local" targetHostName="site1.local" contentStartItem="/sitecore/content/sites/demo/home" rootPath="/sitecore/content/sites/demo"/> <site name="site2" inherits="sitebase" hostName="site2.local" targetHostName="site2.local" contentStartItem="/sitecore/content/sites/site2/home" rootPath="/sitecore/content/sites/site2""/>
The urls in the coveo search page in the first site work correctly.
The urls in the coveo search page in the second site dont form correctly.
<ServerUrl> element in the Coveo.SearchProvider.config is set to site1.local. I think that is why the urls for all the sites resolve to that.
How can I make the urls resolve to their own sites?
Shouldn't this pipeline do this already?
<coveoResolveItemSite> <processor type="Coveo.SearchProvider.Processors.ResolveItemSiteProcessor, Coveo.SearchProviderBase" /> </coveoResolveItemSite>
support for URIs in multisite solutions has been improved and will be available in the July 2015 release.
For now, the best way to resolve URIs on your search pages is to add a processor in the coveoProcessParsedRestResponse pipeline, declared in the Coveo.SearchProvider.Rest.config file.
Simply call Sitecore's LinkManager to resolve the uri correctly. Use the GetItemUri(Item, UrlOptions) method.
In the arguments of this pipeline, you already have the current Sitecontext, which can give you the current database (you need this to retrieve the Sitecore item).