Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lucene Sitecore 7内容搜索索引项位于爬虫根目录之外_Lucene_Sitecore_Sitecore7 - Fatal编程技术网

Lucene Sitecore 7内容搜索索引项位于爬虫根目录之外

Lucene Sitecore 7内容搜索索引项位于爬虫根目录之外,lucene,sitecore,sitecore7,Lucene,Sitecore,Sitecore7,我在Sitecore v7.1中创建了一个自定义内容搜索索引 索引和爬行工作得很好,我能够搜索索引并正确返回项目。我遇到的问题是,索引有时会填充“爬网根”值之外的项(请参阅下面的配置) 到目前为止,解决方法是将模板排除添加到Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config中,但这很烦人,因为我有很多非内容模板,不想继续添加到此文件中 我的索引配置如下(这在配置包含文件中): $(id) $(id) 网状物 /siteco

我在Sitecore v7.1中创建了一个自定义内容搜索索引

索引和爬行工作得很好,我能够搜索索引并正确返回项目。我遇到的问题是,索引有时会填充“爬网根”值之外的项(请参阅下面的配置)

到目前为止,解决方法是将模板排除添加到
Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config
中,但这很烦人,因为我有很多非内容模板,不想继续添加到此文件中

我的索引配置如下(这在配置包含文件中):

$(id) $(id) 网状物 /sitecore/content/Sites/ArtsCentre/Home 正如您所看到的,我的爬虫根标记应该意味着索引只为我的内容项编制索引,而它是从
/sitecore/content/Sites/SiteA/Configuration

这方面的任何帮助都将非常有用:)

干杯,
贾斯汀这是sitecore中的一个bug!据报道,但没有估计何时会被修复

错误出现在
Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf
方法中,它没有进行正确的检查

以下是我从sitecore支持部门得到的建议:

同时,我们建议您实施以下解决方案,以 解决问题:

  • 创建从
    Sitecore.ContentSearch.SitecoreItemCrawler
    类派生的类

  • 重写其IsAncestorOf方法。新方法应如下所示:

  • 将类构建到程序集中。将部件放置到站点的bin文件夹中

  • 注释掉配置中所有出现的SitecoreItemCrawler类。插入新爬网程序定义以使用新爬网程序。 默认情况下,您需要修改以下配置文件:

     Sitecore.ContentSearch.Lucene.Index.Core.config
     Sitecore.ContentSearch.Lucene.Index.Master.config
     Sitecore.ContentSearch.Lucene.Index.Web.config
    
     <!--<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">-->
     <crawler type="[fully qualified class name], [your assembly name]">
    
    Sitecore.ContentSearch.Lucene.Index.Core.config
    Sitecore.ContentSearch.Lucene.Index.Master.config
    Sitecore.ContentSearch.Lucene.Index.Web.config
    
  • 重建索引


  • 小提示:完全重建索引将清除索引并只放入允许的文档(因为它将从文档根开始)。每次你发布东西时,如果它通过了其他检查(模板包含/排除),它就会被放入索引中,因为这个bug!感谢您提供的修复,我将期待实现它,并看看我如何去做。当它通过其他检查并被添加到索引中时,上面的修复程序是否会阻止这种情况发生,但我怀疑这就是正在发生的情况,因为索引的完全重建会删除不应该存在的项。除了CachesDisabler()之外,工作正常。我需要引用什么才能使用它?很抱歉回答得太晚,但CachesDisabler似乎是Sitecore.ContentSearch.dll文件中的一个内部类。但您应该能够使用“Sitecore.Data.DatabaseCacheDisabler”。CachesDisabler只是DatabaseCacheDisabler的包装器。我将用这个代码注释更新答案,说明这在V7.2上是固定的,而且
    CachesDisabler()
    是误导性的,因为只有在设置
    下的
    Sitecore.ContentSearch.config
    中配置该设置时,它才会禁用缓存
     Sitecore.ContentSearch.Lucene.Index.Core.config
     Sitecore.ContentSearch.Lucene.Index.Master.config
     Sitecore.ContentSearch.Lucene.Index.Web.config
    
     <!--<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">-->
     <crawler type="[fully qualified class name], [your assembly name]">