I am moving indexes from Lucene to Solr. Almost everything is working again, except a few custom indexes that have their own index configuration and had some field added to the fieldMap. Other custom indexes are working. The error I get when starting the site is:
[KeyNotFoundException: The given key was not present in the dictionary.] System.Collections.Generic.Dictionary`2.get_Item(TKey key) +13763335
Sitecore.ContentSearch.SolrProvider.SolrFieldMap.AddFieldByFieldName(XmlNode configNode) +618[TargetInvocationException: Exception has been thrown by the target of an invocation.] X.X.Web.Global.Application_Error(Object sender, EventArgs e) in ...\Global.asax.cs:76 System.Web.HttpApplication.RaiseOnError() +211
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +544
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +716
The index config now:
<indexConfigurations>
<CustomIndexConfiguration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration">
<fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="text" returnType="string" />
<field fieldName="webshops" returnType="string" />
<field fieldName="attributes" returnType="string" />
</fieldNames>
</fieldMap>
<documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
...
</documentOptions>
</CustomIndexConfiguration>
</indexConfigurations>
My old Lucene config had a fieldMap like this:
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="text" storageType="YES" indexType="UNTOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"/>
<field fieldName="webshops" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"/>
<field fieldName="attributes" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
</fieldNames>
I am definitely missing something (otherwise I wouldn't get an error). Buy what?
Using Sitecore 8.1-upd3, Solr 4.10.3, Autofac 4.1, ...