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:
- 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”.
- Similarly copy the “sitecore_web_index” folder in C:\solrx\server\solr and create another folder named “sitecore_web_index_rebuild”.
- Open
the core.properties in
C:\solrx\server\solr\sitecore_web_index_rebuild folder. Replace with the secondary
core name.
- Restart the Solr service and check the Solr URL.
- Open
the Solr index config for the “sitecore_web_index. Replace SwitchOnRebuildSolrSearchIndex
instead of SolrSearchIndex and add the rebuildcore settings.
- 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
Post a Comment