目前,我已经为所有三个数据库(主数据库、web数据库和核心数据库)配置了IntervalAsynchronousStrategy,它们在指定的时间间隔后重建索引,但我想要更改索引策略,以便索引应该只在发布之后发生,而不是在每个指定的时间间隔之后。我尝试通过在仅针对master数据库的配置文件中定义以下配置来更改策略:
<onPublishEndAsync type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch">
<param desc="database">master</param>
<CheckForThreshold>true</CheckForThreshold>
</onPublishEndAsync>将此策略与索引一起附加:
<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“。然后发布项目,但索引文件夹不是在发布后创建的。
我是否遗漏了任何配置?
发布于 2015-10-21 21:48:00
OnPublishEndAsync策略仅适用于作为发布目标的数据库。在大多数情况下,它只是web数据库。此策略仅在启用EventQueue时有效。
对于主数据库,您应该使用syncMaster或intervalAsyncMaster策略。
有关更多细节,请阅读John West的Sitecore: Index Update Strategies博客文章。
https://stackoverflow.com/questions/33260950
复制相似问题