我正在使用Sitecore 7.2。我创建了一个自定义的Lucene索引。未从Lucene索引获取类型Droplist和TreeList的字段值
虽然我能够得到Single-line Text
类型的字段的值,Rich Text
& DateTime
,我没有得到的类型,如Droplist
和TreeList
字段的值。
我已经尝试将这些字段的indexType更改为“UNTOKENISED”,但仍然继续出现此问题。我还使用Luke检查了我的索引,并观察到只有标题,摘要和正文字段是索引的一部分。
下面是我在我的字段中定义的索引配置部分。 products
和type
分别是Treelist
和Droplist
字段。
<fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="title" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
<field fieldName="summary" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
<field fieldName="body" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
<field fieldName="datemodified" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
<field fieldName="products" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
<fieldType fieldName="type" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String"
settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
</fieldNames>
</fieldMap>
我使用从索引中取值的类是如下:
public class DownloadResult : SearchResultItem
{
[IndexField("title")]
public string Title { get; set; }
[IndexField("summary")]
public string Summary { get; set; }
[IndexField("type")]
public string Type { get; set; }
[IndexField("body")]
public string Body { get; set; }
[IndexField("datemodified")]
public DateTime DateModified { get; set; }
[indexfield("products")]
public string products { get; set; }
}
什么是你正在使用的搜索类是什么样子? –
当你在卢克看场时,它有价值吗? –
@dnstommy是的。当我将类型更改为单行文本并重建索引时,会返回值。 – Sairaj