我们正在将项目从 sitecore 6.2 迁移到 sitecore 7.1。
我正在尝试在升级 Lucene Search 后安装 Active Directory 包“Sitecore Active Directory 1.1 rev. 130705”。
我收到错误
"Sitecore.Exceptions.ConfigurationException: Could not create instance of type: Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer. No matching constructor was found.".
这是我尝试使用 sitecore 7.1 中的安装向导安装软件包时
最佳答案
如 Exception Message
指出 Sitecore 的 ContentSearch
存在问题.它与 Lucene 的版本或升级问题无关。问题的根源是不正确的 Lucene 或 Solr(取决于您使用的是哪个)IndexConfiguration.config
文件。
先检查这个
在继续之前,请确保它不是人为错误。如果您在 App_Config/Includes/
中有索引文件,则会显示此错误。不止一次。或者如果两个或多个索引配置文件具有相同的 xml 元素名称。
选项 1 - 删除文件
您可以从 /App_Config/Includes/
中删除有问题的 IndexConfiguration.config。文件夹并更新相关 Index
配置文件以使用 DefaultIndexConfiguration
在 configuration
XML 节点;
<configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
选项 2 - 修复文件
另一个选项是修改自定义 IndexConfiguration。大多数开发人员都熟悉创建自定义
Index
通过复制配置文件的全部内容,因此将复制整个 DefaultIndexconfiguration
配置以创建自定义 IndexConfiguration
导致异常。这是不需要的。您只需要
DefaultIndexconfiguration
中的少量设置。配置如本博客中所示如何create a custom IndexConfiguration .
关于lucene - 无法创建类型为 : Sitecore. ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer 的实例。找不到匹配的构造函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20391738/