【发布时间】:2014-03-05 12:42:40
【问题描述】:
在我们的模板中,我们定义了一个 Multilist 字段。我们将此字段添加到 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">
当它在此文件中显示<IndexAllFields>true</IndexAllFields> 时,为什么有必要这样做?
添加此行并发布所有内容后,我们会看到该字段出现在 Luke 工具的概览选项卡中。但在“文档”选项卡中,该字段仍然缺失。此外,当我们使用 .Net 在网络索引上进行内容搜索时,该字段始终为空:
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; }
}
apps_or 是出现在 Luke 工具中的索引名称。任何想法如何正确获取索引中的字段并通过 .Net 提供它??
非常感谢提前 罗伯特
【问题讨论】:
-
你可以尝试使用 List
而不是 IEnumerable ,我不是 100% 确定它会起作用,我记得我之前看到过这个问题... -
不幸的是,同样的行为。当类型错误时,人们会期待异常吗?搜索后是否有可能包含此类信息的日志文件?
-
您描述的行为是Lucene中索引但未存储的字段的典型行为。不过,我对 Sitecore 的了解还不够,无法看到您所拥有的任何问题。
storageType="YES"听起来对我来说是正确的,但它似乎仍然没有被存储。希望这能为您指明正确的方向。
标签: .net lucene sitecore sitecore7