Sitecore、Solr、CommerceServer 配置问题

Sitecore, Solr, CommerceServer config issues

刚刚完成将 Sitecore 8.2(带 CommerceServer)实例转换为使用 Solr 而不是 Lucene。我一直在关注这篇文章:

http://blog.alpha-solutions.us/2016/10/how-to-use-solr-with-sitecore-8-2-with-solr-6-the-easy-way/

在设置结束时我的站点/CMS 给我这个错误:

“/”应用程序中的服务器错误。

字典中不存在给定的键。

问题描述:当前网络请求执行过程中出现未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Collections.Generic.KeyNotFoundException:字典中不存在给定的键。

来源错误:

在执行当前网络请求的过程中产生了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常来源和位置的信息。

堆栈跟踪:

[KeyNotFoundException: 字典中不存在给定的键。] System.Collections.Generic.Dictionary`2.get_Item(TKey键)+14331515 Sitecore.ContentSearch.SolrProvider.SolrFieldMap.AddFieldByFieldName(XmlNode 配置节点) +647

知道这是什么吗?我想也许我在某处缺少配置。

提前致谢。

检查您的 Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config 文件或自定义索引配置(如果有的话)。会有这样的字段图部分:

      <fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
        <fieldNames hint="raw:AddFieldByFieldName">
          <field fieldName="Yourfield" returnType="string" />
        </fieldNames/>
      </fieldMap>

字段的配置在某处是错误的。

如果您有自定义索引配置,请务必确保 fieldMap 元素是使用 ref 而不是类型设置的:

 <fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">

确保在 之前包含

<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">
  <typeMatches hint="raw:AddTypeMatch"></typeMatches>
  <fieldNames hint="raw:AddFieldByFieldName">
        ....
  </fieldNames>
</fieldMap>