ZERO DOWNTIME - SOLR SWITCH INDEX REBUILD

We always have to worry about downtime or slowness in the website when the index is triggered. Our website search might stop or a few functionalities will be missing.

You can set up Solr to rebuild an index in a separate core so that the rebuilding does not affect the search index that is currently used. Once the index’s rebuilding and optimization are completed, Sitecore switches the two cores to get the expected output.

The SwitchOnRebuildSolrSearchIndex class inherits from the SolrSearchIndex class and adds the capability of maintaining two cores for a particular index. Sitecore switches the primary and secondary cores by sending a SWAP request to Solr.

Please follow the below steps:

  1. Let’s have “sitecore_web_index” as the Primary core. Copy the “sitecore_web_index” in C:\solrx\server\cores_data and create a Secondary core named “sitecore_web_index_rebuild”.

  2. Similarly copy the “sitecore_web_index” folder in C:\solrx\server\solr and create another folder named “sitecore_web_index_rebuild”.
  3. Open the core.properties in  C:\solrx\server\solr\sitecore_web_index_rebuild folder. Replace with the secondary core name.

  4. Restart the Solr service and check the Solr URL.
  5. Open the Solr index config for the “sitecore_web_index. Replace SwitchOnRebuildSolrSearchIndex instead of SolrSearchIndex and add the rebuildcore settings. 

  6. When you try to run the “sitecore_web_index”, you will realize the folders are getting swapped which will not bring your Sitecore down.

Think Sitecore!
Thank You!


Comments

Popular posts from this blog

Sitecore CLI Serialization - Installation and troubleshooting

Alternate URLs Using Aliases In Sitecore