Coveo for Sitecore. Index per site (not sitecore path)
This may seem odd at first but here goes. We have 11 sites defined in the site definition files. Each site shares the same content tree path
/sitecore/content/TheSite however the site definition also specifies the language so it will show content based on the language. The url is different but NOT the sitecore content tree path.
In the index I see an option set the root which is fine but can I set the language. This would allow me to use 1 index per site.
<crawler type="Coveo.SearchProvider.CoveoItemCrawler, Coveo.SearchProviderBase"> <Database>web</Database> <Root>/sitecore/content/siteroot1</Root> <StopOnError>true</StopOnError> </crawler>
Is this possible? Is there another way I should be doing it?
Coveo recommands using 1 index and filter at query time. With your use case, the OOTB search page does exactly what you are trying to do. You will need to:
- Add a rule "where the item is the specific item or one of its subitem" on the CoveoSearch component to filter everything outside your site root.
- Ensure the "Filter results on the current context language" option on the search component is "true". This will add an additional filter to the advanced expression of the REST query to return results in the context language only. The context language should be determined automatically by Sitecore.
If you are using the free edition, filter expressions can be added easily : https://developers.coveo.com/display/public/SitecoreV3/Adding+Filter+and+Boost+Expressions+Programmatically.
The CoveoItemCrawler inherits Sitecore's SitecoreItemCrawler. They offer the same options. The Coveo crawler fixes some limitations of the Sitecore crawler that were fixed in Sitecore 8.1. If you use Sitecore 8.1, you could replace the CoveoItemCrawler by the SitecoreItemCrawler (the OOTB index configuration of C4SC 3.0 for Sitecore 8.1 June 2016 release will use the SitecoreItemCrawler).