Reputation: 199
I have been given the task of implementing content search in a Sitecore (ver. 7.2) based website. For the same, I am planning to use the Lucene search provider as it comes bundled with Sitecore out of the box and also since our search requirements don't seem too exhaustive for me to attempt using Solr. We want users to be able to search a bucketable list of content residing in Sitecore from the main site. The documentation and blogs explaining how to do this are sketchy and incomplete.
I used the below blog as a reference point:
http://www.mattburkedev.com/sitecore-7-contentsearch-tips/
After adding the index configuration file in App_Config/Include folder, I expected to see the new index in Sitecore's Indexing Manager. However i do not notice the same there. Any ideas on what I'm doing wrong?
I wanted to create a custom index so that I can target only particular sitecore nodes. Please see my configuration file. I only need to search for data within the articles node using the fields set in the articles item template.
<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="book_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, 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/syncMaster" />
</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>master</Database>
<Root>/sitecore/content/support/articles</Root>
</crawler>
</locations>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
Upvotes: 0
Views: 689
Reputation: 1081
Just rename your config file to z.Sitecore.ContentSearch.Lucene.Downloads.config
This is because when sitecore will merge all your configs in one file, the filename is taken into consideration.
Thanks
Upvotes: 1
Reputation: 199
I was finally able to see my index in the Indexing Manager. There seemed to be a problem with the name of the config file. I named my index file "Sitecore.ContentSearch.Lucene.Downloads.config" and after that, the index appeared. The file was being patched in before the standard Lucene config and hence the issue.
Upvotes: 1
Reputation: 1435
Some of your namespaces are off in your config. Please try this config and see if it shows up for you. I have modified it to match your parameters. This should work for you.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="book_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, 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)" />
<configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
<strategies hint="list:AddStrategy">
<!-- NOTE: order of these is controls the execution order -->
<strategy ref="contentSearch/indexUpdateStrategies/syncMaster" />
</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>master</Database>
<Root>/sitecore/content/support/articles</Root>
</crawler>
</locations>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
Upvotes: 0