I'm working on a project based on ez Platform CMS connected with SOLR (version 6.6.6). (more detals: https://doc.ezplatform.com/en/2.5/guide/search/solr/)
Now I'm trying configure Solr to deal with sorting with special characters (especially polish).
I have found that I need to add filter solr.CollationKeyFilterFactory
to my managed-schema like this:
<!-- sorl/server/ez/myappcore/conf/managed-schema -->
<fieldType name="string" class="solr.TextField" sortMissingLast="true">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.CollationKeyFilterFactory" language="pl" country="PL" strength="primary" />
</analyzer>
</fieldType>
And next load required jars by add <lib>
to solrconfig.xml
:
<!-- sorl/server/ez/myappcore/conf/solrconfig.xml -->
<config>
<luceneMatchVersion>6.6.6</luceneMatchVersion>
<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
<lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
<lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
<!-- added libs below -->
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-analysis-extras-\d.*\.jar" />
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib/" regex="morfologik-\w*-\d.*\.jar" />
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs/" regex="lucene-analyzers-morfologik-\d.*\.jar" />
<!-- rest of config ... -->
</config>
but after restarting Solr (bin/solr stop -p 8983 && bin/solr -s ez
) in dashboard (http://localhost:8983/solr/
) I have error message:
myappcore: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core myappcore: Can't load schema /Users/maciek/Sites/solr/solr-6.6.6/server/ez/myappcore/conf/managed-schema: Plugin init failure for [schema.xml] fieldType "string": Plugin init failure for [schema.xml] analyzer/filter: Error loading class 'solr.CollationKeyFilterFactory'
I think there is a problem with missing or not loaded one of the jars (Error loading class 'solr.CollationKeyFilterFactory'
) but I have no idea where I'm wrong...
so please help because I have spent hours to search any info on Internet and random tries...
Many thanks! ;)