Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.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
Asp.net 在Solr'中定义Sitecore字段;s schema.xml_Asp.net_Solr_Sitecore - Fatal编程技术网

Asp.net 在Solr'中定义Sitecore字段;s schema.xml

Asp.net 在Solr'中定义Sitecore字段;s schema.xml,asp.net,solr,sitecore,Asp.net,Solr,Sitecore,我在Sitecore 7实例的数据模板上有一个名为CountryName的自定义文本字段。我已经设置了一个返回此字段的搜索结果项 [IndexField("CountryName")] public string CountryName { get; set; } 由于my Solr schema.xml中的catchall Sitecore配置,Solr正在为该字段编制索引。但是,使用默认标记器会导致对该字段进行排序的调用出现问题,并且排序顺序混乱。我更愿意使用alphaOn

我在Sitecore 7实例的数据模板上有一个名为CountryName的自定义文本字段。我已经设置了一个返回此字段的搜索结果项

    [IndexField("CountryName")]
    public string CountryName { get; set; }
由于my Solr schema.xml中的catchall Sitecore配置,Solr正在为该字段编制索引。但是,使用默认标记器会导致对该字段进行排序的调用出现问题,并且排序顺序混乱。我更愿意使用alphaOnlySort的字段类型来缓解这个问题

我尝试将以下两行添加到Solr Schema.xml文件中,但没有成功:

<field name="CountryName" type="alphaOnlySort" indexed="true" stored="true" />
<dynamicField name="Country*" type="alphaOnlySort" indexed="true" stored="true" />


这没用。如果我将*\t DynamicField定义更改为使用alphaOnlySort,它会像一个符咒一样工作。我知道我只是在某个地方错过了一步。有人能指出我在哪里漏了一步吗?谢谢

您需要匹配SiteCore发送的字段名。您可以在管理UI中检查这一点,或者直接查询Solr索引

我不知道Sitecore,但根据您的描述,它必须在名称中添加后缀,以确保它们与dynamicField定义匹配

因此,您可能需要使用:


然后记得重新编制索引。

非常感谢你,Alexandre!我遇到的问题确实与字段命名约定有关,Sitecore确实在字段名后面加了一个_t。你写的定义正好解决了我的问题。再次感谢!