Gravatar for jason.wilkerson@rbaconsulting.com

Question by jason_wilkerson, Jun 1, 2015 1:07 PM

Changing root in SearchProvider.config breaks the search api service

In the Coveo.SearchProvider.config file, I changed the Root field from /sitecore to the root of my site's content node. However, when I make this change, it breaks the Search API. When I open the CoveoDiagnosticsPage, it says that there was an error with the Coveo Search REST Endpoint.

If I want Coveo to only index my content (not /sitecore/templates, /sitecore/layouts, etc…) do I need to change it somewhere else as well?

Here's what the change looked like (I changed it for the Coveomasterindex as well as Coveowebindex):

<locations hint="list:AddCrawler">
  <crawler type="Coveo.SearchProvider.CoveoItemCrawler, Coveo.SearchProviderBase">
    <Database>master</Database>
    <Root>/sitecore/content/MySite</Root>
    <StopOnError>true</StopOnError>
  </crawler>
</locations>

Thanks!

2 Replies
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jun 1, 2015 1:28 PM

Hi Jason,

Unfortunately, it is currently impossible to modify the crawler root this way. Coveo for Sitecore needs to be able to index the indexed database's root item because in some cases we need to get its IIndexable object when we need to do operations without a Sitecore context.

The best way to change what's indexed is using inbound filters.

We ship Coveo for Sitecore with a commented inclusion inbound filter in the Coveo.SearchProvider.config file under the sitecore/pipelines/indexing.filterIndex.inbound element. You can uncomment it, change the paths and rebuild your indexes.

<!-- Uncomment this to use an inbound filter on item paths. By default, it will only index items in
      /sitecore/content. You can specify multiple paths by separating them with a semi-colon. -->
<!-- <processor type="Coveo.SearchProvider.InboundFilters.ItemPathInboundFilter, Coveo.SearchProviderBase">
  <ContentStartPaths>/sitecore/content</ContentStartPaths>
</processor> -->

If you're on Sitecore 7.X with the default Coveo for Sitecore configuration, it is not recommended to index only parts of the Sitecore content tree. This is because Coveo for Sitecore replaces the Lucene indexes. Indexing only a part of the content tree will affect the Content Editor search (you won't be able to search for all the items).

If you're on Sitecore 8.X (or 7.2+ with a modified Coveo for Sitecore configuration to enable side-by-side indexing with Lucene), you can use inbound filters without problem.

Gravatar for jason.wilkerson@rbaconsulting.com

Comment by jason_wilkerson, Jun 1, 2015 2:03 PM

Thank you, that's exactly what I was looking for!

Gravatar for slangevin@coveo.com

Answer by Simon, Jun 1, 2015 1:12 PM

Hi Jason,

I would recommend not to change the root. Instead, use inbound filtering: https://developers.coveo.com/display/public/SC201504/Controlling+What+Gets+Indexed+and+How

You can also create a new index for a subsection of the site but I highly recommend filtering.

Cheers,
Simon

Ask a question