Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not create instance of type: Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer. No matching constructor was found

We are migrating the project from sitecore 6.2 to sitecore 7.1.

I am trying to install the Active Directory Package "Sitecore Active Directory 1.1 rev. 130705" after upgrade of Lucene Search. I am getting the error

"Sitecore.Exceptions.ConfigurationException: Could not create instance of type: Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer. No matching constructor was found.".

This is when I try to install the package using Installation wizard in sitecore 7.1

like image 955
Mohan Rangaswamaiah Avatar asked Nov 24 '22 09:11

Mohan Rangaswamaiah


1 Answers

As the Exception Message states its an issue with Sitecore's ContentSearch. It's not relating to version of Lucene or upgrade issues. The source of the issue is an incorrect Lucene or Solr (depending on which on you are using) IndexConfiguration.config file.

Check this first

Before proceeding make sure its not human error. This error will be displayed if you have the index file in the App_Config/Includes/ more than once. Or if two or more Index Configuration files with the same xml element name.

Option 1 - Remove the file

You can either remove the offending IndexConfiguration.config from the /App_Config/Includes/ folder and update the relating Index config files to use the DefaultIndexConfiguration in the configuration XML node;

<configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />

Option 2 - Fix the file

The other option is to amend the custom IndexConfiguration. Most developers are familiar with creating a custom Index by copying the entire content of the config file so will copy the entire DefaultIndexconfiguration config to create a custom IndexConfiguration causing the Exception. This is not needed.

You only need a small number of the settings from the DefaultIndexconfiguration config as shown in this blog on how to create a custom IndexConfiguration.

like image 76
Jonathan Robbins Avatar answered Nov 25 '22 21:11

Jonathan Robbins