solrmigrationsolr4solr5

Solr upgrade from 4.10 to 5.3.3, plugin init failure solr.ICUcollationField


I am currently working on upgrading multiple solr cores(3) from version 4.10 to 5.3.3 (and then to 6.2). I did a fresh install of solr 5.3.3, and then added my cores to the new installation.

We also use the libraries, icu4j , lucene-analyzers-icu , solr-analysis-extras, so I loaded them for version 5.3.3. One of the core works fine, as it does not have any custom field type defined. But, with the other two cores I am getting the below errors, Initially I received error

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core product: Can't load schema /var/solr/data/cores/product/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "text_sortable": Error loading class 'solr.ICUCollationField'

So, I removed the below line from schema.xml, and the above error disappaeared,

<fieldType name="text_sortable" class="solr.ICUCollationField" locale="" strength="primary"/>

But now I am receiving the below error,

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: JVM Error creating core [suggest]: An SPI class of type org.apache.lucene.analysis.util.CharFilterFactory with classname org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory does not exist, please fix the file 'META-INF/services/org.apache.lucene.analysis.util.CharFilterFactory' in your classpath.

I am not sure how to proceed from here, Any suggestions on how to fix the above error will be helpful


Solution

  • For anyone coming across this in the future: the ICU fields require the icu4j library to be loaded. You can check the Solr log to see which libraries are actually being loaded by Solr when it's starting up.

    According to your log you're loading the wrong set of jars in your classloader. The correct jar for ICU is the one without any extra naming, such as sources, etc. The current version is named icu4j-54_1_1.jar.