Reputation: 1345
I have a custom Lucene file which i need to convert into Solr. The config file looks something like the one mentioned below. How do we convert into 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>
Upvotes: 3
Views: 724
Reputation: 2635
Had to do this a while ago, and I took a look at the default Solr indexConfig to figure out what I had to change. As this was on a different version of Sitecore, I'm not sure that the exact differences will be the same for you.
It went rather smoothly though. It's mostly changing the types and ref's from the Lucene to the Solr variant, but make sure you also verify that the elements are still the same.
Biggest change will be your fieldMap. In my case it change to something like this:
<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="..." returnType="string" />
<field fieldName="..." returnType="string" />
...
</fieldNames>
</fieldMap>
So I have ref to the default (instead of the type) and I had to change the field definitions to a Solr config. In your case you will only have to add the "Value" as string.
As mentioned, you can find examples in the default config...
Upvotes: 1