When rebuilding indexes on a content delivery server, any components that search that index fail (blow up). How can I rebuild my index without causing the search components to be unavailable? Furthermore, is there a standard way to handle this?
The code I'm using to perform the reindex on regular intervals:
Sitecore.Data.Database db = Sitecore.Configuration.Factory.GetDatabase(DBName);
Index index = db.Indexes[IndexName];
index.GetSearcher(db).Close();
index.Rebuild(db);
To give a little context:
- Sitecore version - 6.4.1 (rev. 110324)
- It is necessary to rebuild the index because it contains some data from Sitecore and some data from an external system.