Posts

Showing posts from April, 2022

Sitecore: Solr Index rebuild automatically using c# code

Image
Note : if you are not aware or Sitecore CMS please click here Problem Statement :  In our project architecture we have multiple CD server in different azure cloud Geo-locations. But during Go live and outage we need to switch to DR (disaster recovery) server for certain period of time. So there is a requirement to sync the Live Sitecore CD (content deliver) server with the DR server after certain period of time. We achieve this using SQL database transactional replication. But one challenge faced during Solr index rebuild. We have to do manual Solr index rebuild on DR server after every 24 hrs. Solution : Step 1: Create a new separate project " SitecoreTasks" with below code base using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SitecoreTasks {     public class AutoIndexRebuildAgent     {         public string CoreList { get ; s