我用添加以下代码ComputedIndexFields.config文件:简单Sitecore的包含文件出了问题(ComputedIndexFields.config)
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration>
<defaultIndexConfiguration>
<fields hint="raw:AddComputedIndexField">
<field fieldName="AppliedThemes" storageType="yes" indexType="TOKENIZED">be.extensions.AppliedThemes, be.extensions</field>
</fields>
</defaultIndexConfiguration>
</configuration>
</contentSearch>
</sitecore>
</configuration>
我还添加了类中说assemlby:
namespace be.extensions
{
class AppliedThemes : IComputedIndexField
{
public string FieldName { get; set; }
public string ReturnType { get; set; }
public object ComputeFieldValue(IIndexable indexable)
{
Item item = indexable as SitecoreIndexableItem;
if (item == null)
return null;
var themes = item["Themes"];
if (themes == null)
return null;
// TODO
}
}
}
这是添加计算索引字段的基础。然而,当我添加这两个文件(代码在类文件中永远不会到达),当我打开内容编辑器时出现以下错误:
SearchConfiguration配置不正确。预期ContentSearchConfiguration但返回了System.String。
没有这个简单的配置文件一切工作正常。
有没有人看到我在这里做错了什么,或知道我可以尝试解决这个问题?
编辑:我使用Sitecore的8更新2
Sitecore的是什么你使用的是哪个版本? –
Sitecore 8更新2 – Timon
您是否查看了/sitecore/admin/showconfig.aspx页面以确保修补程序工作正常? –