【问题标题】:Why is SwitchOnRebuildLuceneIndex still giving downtime?为什么 SwitchOnRebuildLuceneIndex 仍然给停机时间?
【发布时间】:2016-05-09 06:57:54
【问题描述】:

我已将“Products_index”定义为使用 SwitchOnRebuildLuceneIndex 类型来重建自身。我看到索引生成 2 个文件夹:“Products_index”和“Products_index_sec”。但是,当我手动重建索引(sitecore 控制面板)并同时尝试从索引中获取结果时,重建 secondary 索引时不会返回结果。

所以场景:

  1. 手动重建索引
  2. 同时索引正在返回结果。
  3. 重建索引完成。
  4. 一切正常。
  5. 手动重建索引(再次)(所以现在它正在重建二级文件夹)
  6. 同时索引返回结果。
  7. 重建索引完成。
  8. 一切又好了。

索引配置如下所示:

<index id="Products_index" type="Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex, Sitecore.ContentSearch.LuceneProvider">
    ...
    <locations hint="list:AddCrawler">
      <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>master</Database>
        <Root>/sitecore</Root>
      </crawler>
    </locations>
</index>

我正在使用以下代码(通过 Web api 调用)获得结果

using (var searchContext = ContentSearchManager.GetIndex(MediqBusiness.Constants.Search.ProductIndex).CreateSearchContext())
{
    var query = searchContext.GetQueryable<ProductSearchResultItem>().Where(searchItem => searchItem.Name != "__Standard Values"
                && searchItem.TemplateName == "Product" && searchItem.Language == Sitecore.Context.Language.Name);

    //additional query fields here..

    var results = query.GetResults();
    return results;
}

Sitecore 版本:Sitecore.NET 7.2(修订版 141226)

有什么想法吗?

【问题讨论】:

    标签: lucene sitecore


    【解决方案1】:

    我们在使用 Sitecore SwitchOnRebuildLuceneIndex 时遇到了以下问题。我们联系了 Sitecore,他们提供了一个补丁,即 #457624

    SwitchOnRebuildLuceneIndex 通常的作用是在您重建 Sitecore 索引时,它会在目录之间切换。目前假设主目录是 Products_index 并且您启动了重建索引。发生的情况是您现在将点击 Products_index_sec。第二次重建索引时,目录将再次切换到Products_index

    我们观察到您需要重建索引两次。我们已经在 Sitecore 支持门户上记录了一张票,他们从那里向我们提供了补丁 #457624

    谢谢

    【讨论】:

    • 那么您是否像我们一样在索引重建过程中遇到过停机?补丁 #457624 是否已为您解决了这个问题?您能否详细说明该补丁实际修复了什么?
    • 我们遇到了二级索引没有正确重建的问题,我们在日志中有很多错误。自从我们应用补丁以来,我们没有遇到 SwitchOnRebuildLuceneIndex 的任何问题
    • 补丁是否可以在某处下载? Sitecore 是否提供说明/文档来解释补丁实际修复的内容?
    • 您需要联系 Sitecore 支持以获取该补丁,我认为目前没有关于它的文档。
    猜你喜欢
    • 2015-11-17
    • 2015-01-17
    • 2019-03-05
    • 1970-01-01
    • 2017-05-05
    • 2011-08-03
    • 1970-01-01
    • 2020-11-11
    • 1970-01-01
    相关资源
    最近更新 更多