Patrick Jones
Patrick Jones

Reputation: 1926

How to maintain Lucene index availability during rebuild?

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:

Upvotes: 2

Views: 989

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

As Mark Ursino advices in the post How to maintain Sitecore Lucene indexes in huge content delivery webfarm:

You can consider using the open source Sitecore Lucene Refresher that will run a index crawl operation in-memory and will commit the index back to the file system so you don't lose any index content during the rebuild process.

Upvotes: 4

Related Questions