重建期间如何保持Lucene索引的可用性? [英] 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);
提供一些背景信息:
- Sitecore版本-6.4.1(修订版110324)
- 有必要重建索引,因为它包含来自Sitecore的一些数据和来自外部系统的一些数据.
推荐答案
As Mark Ursino advices in the post How to maintain Sitecore Lucene indexes in huge content delivery webfarm:
您可以考虑使用将运行索引的开源 Sitecore Lucene刷新器在内存中进行爬网操作,并将索引提交回文件系统,因此您在重建过程中不会丢失任何索引内容.
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.
这篇关于重建期间如何保持Lucene索引的可用性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!