9

I have an issue that Lucene indexes are not updated or properly created on the content delivery server after a rebuild of the indexes on the content management server or after an item publish. The version I am using is Sitecore 8.1 rev. 151207 and I followed the documentation listed on https://doc.sitecore.net/sitecore_experience_platform/81/setting_up__maintaining/xdb/configuring_servers/configure_a_content_delivery_server to configure the content delivery server. As you would have guessed, Sitecore access is completely blocked on the CD server meaning a rebuild is not possible on that particular server.

I have the following situation:

Databases

  • core
  • master
  • web (serves as the primary database for the content management server)
  • pub (serves as the primary database for the content delivery server and a publishing target is defined for this database)

Servers

  • Content delivery which fetches data from the pub database
  • Content management which uses all other databases to administer Sitecore, but also functions as a staging environment and fetches data from the web database

Index configuration CM

Web lucene index is not disabled since the site is being used as a staging environment.

Index configuration CD

Added additional Lucene index configuration files for the pub database. Secondly disabled all the web index configuration files.

Could someone point me in the right direction on how to set up the Lucene index configuration on both CM and CD servers regarding my setup with the 'web' and 'pub' databases? Secondly can someone explain the mechanism how indexes are actually being updated on the content delivery server when content is updated on the content management server?

2 Answers 2

8

The main thing you need to set up is the Instance Names in your ScalabilitySettings.config file.

The names can be anything they just need to be consistent between the CM and CD.

You can leave these blank and Sitecore will create it's own unique names which can cause issues if you switch IIS sites, so it's safer if you create the names yourself.

On the CD server, change these settings:

 <setting name="InstanceName">
    <patch:attribute name="value">MyCDServer1</patch:attribute>
  </setting>
  <!--  PUBLISHING INSTANCE
        Assigns the instance name of dedicated Sitecore installation for publishing operations.
        When empty, all publishing operations are performed on the local installation of Sitecore.
        Default vaue: (empty)
  -->
  <setting name="Publishing.PublishingInstance">
    <patch:attribute name="value">MyCMServer</patch:attribute>
  </setting>

On the CM Server:

 <setting name="InstanceName">
    <patch:attribute name="value">MyCMServer</patch:attribute>
  </setting>
  <!--  PUBLISHING INSTANCE
        Assigns the instance name of dedicated Sitecore installation for publishing operations.
        When empty, all publishing operations are performed on the local installation of Sitecore.
        Default vaue: (empty)
  -->
  <setting name="Publishing.PublishingInstance">
    <patch:attribute name="value">MyCMServer</patch:attribute>
  </setting>

Also make sure EnableEventQueues setting is set to true.

With this in place, In basic terms (With default settings), if a publish is performed on the CM box the CM box will trigger a publish:end:remote event - this will get added to the EventQueue table in the database (In your case the pub database).

This will then in turn trigger the OnPublishEndAsync index update strategy which will add the new items to the index.

If you need to do a complete rebuild of the content delivery indexes you need to add the strategy - Remote Rebuild in your index configuration

     <strategies hint="list:AddStrategy">
          <!-- NOTE: order of these is controls the execution order -->

            <!- Existing Strategy  here -->                  

          <strategy ref="contentSearch/indexUpdateStrategies/remoteRebuild" />
        </strategies>
1

If you configure your lucene index to use the "RebuildAfterFullPublish" strategy, then per the Sitecore document.

https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/search_and_indexing/indexing/index_update_strategies

During initialization, this strategy subscribes to the OnFullPublishEnd event and it triggers a full index rebuild.

In a distributed environment, the index rebuild is triggered on all remote servers where this strategy is configured. In this case, you must enable the event queue.

<index id="sitecore_index" type="Sitecore.ContentSearch.LuceneProvider.
          LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
   <param desc="name">$(id)</param>
   <param desc="folder">$(id)</param>
   <strategies hint="list:AddStrategy">
      <strategy ref="contentSearch/indexUpdateStrategies/rebuildAfterFullPublish" />
   </strategies>
   <Analyzer ref="search/analyzer" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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