Seeker
Seeker

Reputation: 327

schema.xml changes from Solr4 to Solr5

I'm migrating from Solr 4.6.0 to 5.4.0. We opted to use our old schema.xml instead of using the managed_schema because we have quite a few copyFields. Starting up solr server, we got this error:

Plugin init failure for [schema.xml] fieldType "text_general": Plugin init failure for [schema.xml] analyzer/filter: Error instantiating class: 'org.apache.lucene.analysis.core.StopFilterFactory'

On googling, we saw that StopFilterFactory is not deprecated yet. What could be the problem?

Also there's no comprehensive guide on how to use a schema from Solr4 in Solr5. Any suggestions?

Thanks

Upvotes: 2

Views: 3999

Answers (2)

btaek
btaek

Reputation: 572

I am not sure if you have resolved your error.

There will be some major changes between Solr 4.6.0 and 5.4.0, and I think your error is due to the changes between the 2 different versions. It means your schema.xml is outdated and won't work for SOlr 5.4.0.

I suggest you doing the following:

When you install Solr 5.4.0 and create a new core, Solr will create a managed-schema file in the conf directory of the core directory. I suggest you compare managed-schema file to your old schema.xml file. For example, look for fieldType name="text_general" in your old schema.xml, and see the difference between the contents under fieldType name="text_general" and the contents under fieldType name="text_general" of managed-schema of Solr 5.4.0. One potential way to fix the error is by removing enablePositionIncrements="true" as Neeraj suggested above.

After the fix for the contents under enablePositionIncrements="true", if Solr gives another error regarding your old schema.xml, look for the location of your error in schema.xml and compare it to managed-schema as done above.

Don't forget to remove or move managed-schema file out of the conf directory since the managed-schema probably won't be something you want to use. You would want to use your old schema.xml, right?

Hope this helps.

Upvotes: 0

Neeraj Shukla
Neeraj Shukla

Reputation: 81

Not sure about Solr 5.X.X but solved above issue in Solr 6.1.0 by removing enablePositionIncrements="true" from schema xml.
Solr may throw another error

Plugin init failure for [schema.xml] fieldType "edge_ngram": Plugin init failure for [schema.xml] analyzer/filter: Error instantiating class:'org.apache.lucene.analysis.ngram.EdgeNGramFilterFactory'

Removing side="front" from schema file will remove this error as well.

Upvotes: 8

Related Questions