【发布时间】:2017-01-30 08:09:46
【问题描述】:
带有默认 lucene 的 Sitecore 8.1。我正在使用带有计算字段的自定义索引来存储多列表字段的真实值,而不是 guid。这很有效,我可以在 Luke 工具中看到该字段被索引为文本。
一些值包含空格,但我希望将它们作为整个字段进行索引。问题是这些以标记化的方式被索引,例如“Little Hampton”被索引为“Little”和“Hampton”。
如何使计算字段未标记化地存储?请参阅原始:AddComputedIndexField 部分:
<indexConfigurations>
<myCustomIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
<indexAllFields>true</indexAllFields>
<initializeOnAdd>true</initializeOnAdd>
<analyzer ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/analyzer" />
<fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
<fieldNames hint="raw:AddFieldByFieldName">
<!-- you must have _uniqueid or you wont be able to update the document later -->
<field fieldName="_uniqueid" 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="title" storageType="YES" indexType="UNTOKENIZED" vectorType="YES" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
<field fieldName="summary" storageType="NO" indexType="TOKENIZED" vectorType="YES" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
</fieldNames>
</fieldMap>
<fields hint="raw:AddComputedIndexField">
<!-- resolves selected guids to text values -->
<field storageType="NO" indexType="UNTOKENIZED" fieldName="my multilist field">My.CoolStuff.Class, My.CoolStuff</field>
</fields>
我尝试将 storageType="NO" indexType="UNTOKENIZED" 添加到该字段,但没有影响,它仍然是 tozenized 并存储。
【问题讨论】:
标签: sitecore lucene.net sitecore8 sitecore8.1 sitecore-lucene