首页 > 解决方案 > 未从 solr 索引中删除未发布的站点核心项目

问题描述

当我取消发布站点核心项目时,它不会从我们的自定义 solr 索引中删除。我们正在使用Sitecore.XA.Foundation.VersionSpecific.Search.SxaItemCrawler我们的爬虫类型,版本sitecore9.0.2(rev. 180604)

我已在事件表中确认正在创建 deleteitemremote 和 publishendremote 事件。

更新和添加工作正常,只是删除导致问题。

我们的自定义索引配置:

<index id="customer_sxa_web_index" type="Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex, Sitecore.XA.Foundation.Search.Providers.Solr" role:require="Standalone or ContentDelivery or ContentManagement" search:require="solr">
    <param desc="name">$(id)</param>
    <param desc="core">customer_sxa_cpcproducts_web</param>
    <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
    <strategies hint="list:AddStrategy">
      <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
    </strategies>
    <locations hint="list:AddCrawler">
      <crawler type="Sitecore.XA.Foundation.VersionSpecific.Search.SxaItemCrawler, Sitecore.XA.Foundation.VersionSpecific">
        <Database>web</Database>
        <Root>/sitecore/content/customer-Main/customer-Main/Home</Root>
      </crawler>
      <crawler type="Sitecore.XA.Foundation.VersionSpecific.Search.SxaItemCrawler, Sitecore.XA.Foundation.VersionSpecific">
        <Database>web</Database>
        <Root>/sitecore/content/customer-Main/customer-Main/Data/Product Content/</Root>
      </crawler>
    </locations>
    <enableItemLanguageFallback>false</enableItemLanguageFallback>
    <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>

我希望从搜索索引中删除已删除(未发布)的项目。但这并没有发生。

调查日志发现以下错误,我认为这是由于未发布后该项目在 Web 数据库中不可用

Message: Object reference not set to an instance of an object.
Source: Sitecore.XA.Foundation.VersionSpecific
   at Sitecore.XA.Foundation.VersionSpecific.Search.SxaItemCrawler.IsExcludedFromIndex(IIndexableUniqueId indexableUniqueId, IndexEntryOperationContext operationContext, Boolean checkLocation)
   at Sitecore.ContentSearch.SitecoreItemCrawler.Update(IProviderUpdateContext context, IIndexableUniqueId indexableUniqueId, IndexEntryOperationContext operationContext, IndexingOptions indexingOptions)
   at Sitecore.ContentSearch.AbstractSearchIndex.<>c__DisplayClass94_2.<PerformUpdate>b__0(IndexableInfo info, ParallelLoopState parallelLoopState)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )```

标签: searchsolrsitecore9

解决方案


推荐阅读