.net 如何使用lucene索引多列表

.net 如何使用lucene索引多列表,.net,lucene,sitecore,sitecore7,.net,Lucene,Sitecore,Sitecore7,在我们的模板中,我们定义了一个多列表字段。我们将此字段添加到Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config文件中: <field fieldName="apps_or" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.GUID" settingType="Sitec

在我们的模板中,我们定义了一个多列表字段。我们将此字段添加到Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config文件中:

<field fieldName="apps_or"                storageType="YES"  indexType="TOKENIZED"    vectorType="NO" boost="1f" type="System.GUID" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">

为什么在该文件中显示
true
时需要这样做

添加这一行并发布所有内容后,我们会在Luke工具的Overview选项卡中看到该字段。但在“文档”选项卡中,该字段仍然缺失。此外,当我们使用.Net对web索引进行内容搜索时,字段始终为空:

class NewsSearchResultItem : SearchResultItem
{
    public string Title { get; set; }
    public string Body { get; set; }
    public string Introduction { get; set; }

    [IndexField("apps_or")]
    public IEnumerable<ID> AppIdOr { get; set; }

}
class NewsSearchResultItem:SearchResultItem
{
公共字符串标题{get;set;}
公共字符串体{get;set;}
公共字符串介绍{get;set;}
[IndexField(“apps_或”)]
公共IEnumerable AppIdOr{get;set;}
}
apps_or是索引在Luke工具中显示的名称。如何正确地获取索引中的字段并通过.Net将其提供给用户

非常感谢
罗伯特

你说得对,菲多尔贡!它已编制索引但未存储,显然您必须启用在同一配置文件中存储多列表字段:

<fieldType fieldTypeName="multilist"                          storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String"   settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />


您能否尝试使用List not IEnumerable,我不是100%确定它是否有效,我记得我以前见过这个问题……不幸的是,同样的行为。当类型错误时,会出现异常吗?搜索后是否有包含此类信息的日志文件?您描述的行为是Lucene中索引但未存储的字段的典型行为。不过,我对Sitecore的了解还不够,看不出你的网站有什么问题
storageType=“YES”
听起来很正确,但它似乎仍然没有存储。希望这能为你指明正确的方向。