I've created a custom content search index in Sitecore v7.1.
The indexing and crawling works fine, and I am able to search the index and return items correctly. The issue I am having is that the index sometimes gets populated with items that are outside of the "crawling root" value (see configuration below.
The work around so far has been to add template excludes to the Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config
but this is annoying as I have lots of non-content templates that I don't want to have to continue to add to this file.
My index configuration is as follows (This is in a config include file):
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <contentSearch> <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider"> <indexes hint="list:AddIndex"> <index id="artscentre_web_index" type="Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex, Sitecore.ContentSearch.LuceneProvider"> <param desc="name">$(id)</param> <param desc="folder">$(id)</param> <!-- This initializes index property store. Id has to be set to the index id --> <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" /> <strategies hint="list:AddStrategy"> <!-- NOTE: order of these is controls the execution order --> <strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync" /> </strategies> <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch"> <policies hint="list:AddCommitPolicy"> <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" /> </policies> </commitPolicyExecutor> <locations hint="list:AddCrawler"> <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <Database>web</Database> <Root>/sitecore/content/Sites/ArtsCentre/Home</Root> </crawler> </locations> </index> </indexes> </configuration> </contentSearch> </sitecore> </configuration>
As you can see, my crawler root tag should mean the index only indexes my content items, yet it's indexing items from places such as /sitecore/content/Sites/SiteA/Configuration
Any help on this would be great :)
Cheers, Justin