我有一个自定义的Lucene文件,我需要将其转换为Solr。配置文件看起来像下面提到的那样。我们如何转换成Solr?
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<indexConfigurations>
<customMasterSearchTermConfig type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
<indexAllFields>false</indexAllFields>
<initializeOnAdd>true</initializeOnAdd>
<analyzer ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/analyzer" />
<fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
<fieldNames hint="raw:AddFieldByFieldName">
<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="Subheading" storageType="Yes" indexType="TOKENIZED" vectorType="No" boost="if" type="System.String" settingType=""></field>-->
<field fieldName="Value" 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>-->
</fieldNames>
</fieldMap>
<include hint="list:IncludeField">
<fieldId>{B8978923-AFD2-44F4-8010-F8A0EC79F61D}</fieldId>
</include>
<fieldReaders ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/fieldReaders" />
<indexFieldStorageValueFormatter ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/indexFieldStorageValueFormatter" />
<indexDocumentPropertyMapper ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/indexDocumentPropertyMapper" />
</customMasterSearchTermConfig>
</indexConfigurations>
</contentSearch>
</sitecore>
</configuration>
答案 0 :(得分:1)
不久前还要这样做,我看了一下默认的Solr indexConfig来弄清楚我必须改变什么。由于这是在不同版本的Sitecore上,我不确定您的确切差异是否相同。
虽然进展得相当顺利。它主要改变从Lucene到Solr变体的类型和参考,但请确保您也验证元素仍然相同。
最大的变化是你的fieldMap。在我的情况下,它改为这样的东西:
<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="..." returnType="string" />
<field fieldName="..." returnType="string" />
...
</fieldNames>
</fieldMap>
所以我已经引用了默认值(而不是类型),我不得不将字段定义更改为Solr配置。在您的情况下,您只需要添加&#34;值&#34;作为字符串。
如上所述,您可以在默认配置中找到示例...