SwitchOnRebuildLuceneIndex in sitecore 7.2

SwitchOnRebuildLuceneIndex is an exiting new functionality introduced in sitecore 7.2

The idea is to offer a READ ONLY lucene index available meanwhile you are rebuilding your index.

As you probably already know, you should plan carefully your index strategy to avoid downtime of your site when the index rebuild, but in the lifetime of an enterprise project you will be forced to kick an index rebuild to troubleshoot some issue.

SwitchOnRebuildLuceneIndex  allow you to avoid the downtime of your site, giving a read-only index. It means that if somebody is adding items to the index, these items won’t be returned until the index rebuild is not completed.

At low level when you switch on SwitchOnRebuildLuceneIndex it simply create a copy of the index folder meanwhile is rebuilding the index in a different folder and switch the two folders once that the index rebuild has completed.

The config to use to configure it is the following one:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
          <indexes hint="list:AddIndex">
            <index id="sitecore_web_index" type="Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex, Sitecore.ContentSearch.LuceneProvider">
              <param desc="name">$(id)</param>
              <param desc="folder">$(id)</param>

you can find more information about it in the following post http://blog.eldblom.dk/2014/07/31/avoiding-downtime-while-rebuilding-your-lucene-search-indexes-in-sitecore-asp-net-cms/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s