首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sitecore8 :发布索引策略

Sitecore8 :发布索引策略
EN

Stack Overflow用户
提问于 2015-10-21 21:41:16
回答 1查看 1.4K关注 0票数 0

目前,我已经为所有三个数据库(主数据库、web数据库和核心数据库)配置了IntervalAsynchronousStrategy,它们在指定的时间间隔后重建索引,但我想要更改索引策略,以便索引应该只在发布之后发生,而不是在每个指定的时间间隔之后。我尝试通过在仅针对master数据库的配置文件中定义以下配置来更改策略:

代码语言:javascript
复制
<onPublishEndAsync type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch">
      <param desc="database">master</param>
      <CheckForThreshold>true</CheckForThreshold>
</onPublishEndAsync>

将此策略与索引一起附加:

代码语言:javascript
复制
<indexes hint="list:AddIndex">
      <index id="sitecore_master_media_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
        <param desc="name">$(id)</param>
        <param desc="folder">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
    <strategies hint="list:AddStrategy">
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        </strategies>
        <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
          <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
          </policies>
        </commitPolicyExecutor>
        <locations hint="list:AddCrawler">
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>master</Database>
            <Root>{9076FDC8-33B3-4B97-AC32-640F3481C37F}</Root>
          </crawler>
        </locations>
      </index>

在发布编辑的项目之前,我从/AppData/indexes中删除了索引文件夹"sitecore_master_media_index“。然后发布项目,但索引文件夹不是在发布后创建的。

我是否遗漏了任何配置?

EN

回答 1

Stack Overflow用户

发布于 2015-10-21 21:48:00

OnPublishEndAsync策略仅适用于作为发布目标的数据库。在大多数情况下,它只是web数据库。此策略仅在启用EventQueue时有效。

对于主数据库,您应该使用syncMasterintervalAsyncMaster策略。

有关更多细节,请阅读John West的Sitecore: Index Update Strategies博客文章。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33260950

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档