Tuesday, April 19, 2016

Sitecore Lucene include and exclude template warning

With my Lucene indexes I tend to include the relevant templates which I want included in the index. This will often lead to the following warning:
You have specified both IncludeTemplates and ExcludeTemplates. This logic is not supported. Exclude templates will be ignored.
 Inside the default Lucene configuration file (/App_Config/Include/Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config) there is a section with some templates excluded by default:

<exclude hint="list:AddExcludedTemplate">

As the error suggests, with Lucene search in Sitecore you can't both include and exclude templates. Therefore as I choose to decide on what templates to include (opt-in rather than opt-out), this section can be commented out which fixes the warning throughout the logs.

No comments:

Post a Comment