0

I have inherited a very old and messy instance of Sitecore 7. Ive decided to cleanup some of the config files and im starting with the indexes. There are a few custom indexes that i noticed don't show in the index manager popup. I presume because the below declaration uses Sitecore search and not Lucene. Does anyone know, if there is a way i can get them to appear?

 <configuration type="Sitecore.Search.SearchConfiguration, Sitecore.Kernel" singleinstance="true">
        <indexes hint="list:AddIndex">
         <index id="centresearch" type="Sitecore.Search.Index, Sitecore.Kernel">
           <param desc="name">$(id)</param>
           <param desc="folder">$(id)</param>
           <analyzer ref="search/analyzer" />
           <locations hint="list:AddCrawler">
            <web type="Global.Application.Search.CentreSearchCrawler, Global.Application">
                <Database>web</Database>
                <Tags>web content</Tags>
                <Root>/sitecore/content/Global/Centres</Root>
            </web>
           </locations>
         </index>
        </indexes>
     </configuration>
  • 1
    Sitecore.Search.Index type was used in Sitecore 6. You can try changing it to Sitecore.ContentSearch.LuceneProvider.LuceneIndex and update all the require properties like configuration and strategies – Marek Musielak Feb 28 '18 at 15:51
2

You configuration should look like this one :

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
   <contentSearch>
    <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
    <indexes hint="list:AddIndex">
      <index id="centersearch" 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/onPublishEndAsync" />
        </strategies>
        <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
          <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
              <Limit>300</Limit>
            </policy>
          </policies>
        </commitPolicyExecutor>
        <locations hint="list:AddCrawler">
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>web</Database>
            <Root>/sitecore/content/Global/Centres</Root>
          </crawler>
        </locations>
      </index>
    </indexes>
  </configuration>
  </contentSearch>
</sitecore>
</configuration>

I remarked you have a custom crawler, you should modify

    <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">

with you custom crawler class

  • Thanks but the problem is that i get an error when i add my custom crawler to the crawler node. I suspect its because the custom crawler class inreits from the wrong base class. It inherits from Sitecore.Search.Crawlers.DatabaseCrawler not SitecoreItemCrawler – Richard Banks Feb 28 '18 at 16:29
  • Can you add crawler code to the question? – Vlad Iobagiu Feb 28 '18 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.