cancel
Showing results for 
Search instead for 
Did you mean: 

Polish language to Solr

Former Member
0 Kudos

Hi, I'm trying to add a new language Polish to Solr schema.xml . Apache says to use

 <filter class="solr.StempelPolishStemFilterFactory" />
 

for Polish but when I add this in Schema.xml and tried to restart it is unable to find this Stemmer. Is the Stempel library not included with Solr in hybris 5.2? Is there any other library that supports polish available in hybris 5.2?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I am also trying to add polish to Solr with hybris 5.4

Here a snipset of my schema.xml:

         <analyzer>
             <tokenizer class="solr.StandardTokenizerFactory" />
             <filter class="solr.StandardFilterFactory" />
             <filter class="solr.LowerCaseFilterFactory" />
             <filter    class="de.hybris.platform.solrfacetsearch.ysolr.synonyms.HybrisSynonymFilterFactory" ignoreCase="true" synonyms="pl" coreName="${solr.core.name}"/>
             <filter class="solr.WordDelimiterFilterFactory"
                 generateWordParts="1" generateNumberParts="1" catenateWords="1"
                 catenateNumbers="1" catenateAll="0" splitOnCaseChange="0" />
             <filter    class="de.hybris.platform.solrfacetsearch.ysolr.stopwords.HybrisStopWordsFilterFactory" ignoreCase="true" lang="pl" coreName="${solr.core.name}"/>
             <filter class="solr.StopFilterFactory" words="lang/stopwords_pl.txt" ignoreCase="true" />
             <filter class="solr.ASCIIFoldingFilterFactory" />
             <filter class="solr.SnowballPorterFilterFactory" language="Polish"/>
         </analyzer>
     </fieldType>

.. I have tried all three filters, but I am always gettin an error.

Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "text_spell_pl": Plugin init failure for [schema.xml] analyzer/filter: Error loading class 'solr.MorfologikFilterFactory'

What am I doing wrong?

Best Regards, Elizabet

Former Member
0 Kudos

Hi Ashwan,

To add a new language to solr, you need put additional fields in schema.xml file under yoursolrserver/solr/server/multicore/conf folder. This is achieved by copy-pasting what's already there for existing languages, for example the text fieldtype :

 <fieldType name="text_pl" class="solr.TextField" positionIncrementGap="100">
             <analyzer>
                 <tokenizer class="solr.StandardTokenizerFactory" />
                 <filter class="solr.StandardFilterFactory" />
                 <filter class="solr.LowerCaseFilterFactory" />
                 <filter  class="de.hybris.platform.solrfacetsearch.ysolr.synonyms.HybrisSynonymFilterFactory" ignoreCase="true" synonyms="pl" coreName="${solr.core.name}"/>
                 <filter class="solr.WordDelimiterFilterFactory"
                     generateWordParts="1" generateNumberParts="1" catenateWords="1"
                     catenateNumbers="1" catenateAll="0" splitOnCaseChange="0" />
                 <filter  class="de.hybris.platform.solrfacetsearch.ysolr.stopwords.HybrisStopWordsFilterFactory" ignoreCase="true" lang="pl" coreName="${solr.core.name}"/>
                 <filter class="solr.StopFilterFactory" words="stopwords_pl.txt" ignoreCase="true" />
                 <filter class="solr.ASCIIFoldingFilterFactory" />
                 <filter class="solr.SnowballPorterFilterFactory" language="Polish" />
             </analyzer>
         </fieldType>


Best Regards,

Amel.

Former Member
0 Kudos

Hi Amel, Thanks for your response

The SnowballPorterFilterFactory is not valid for Polish language, According to apache polish language can be added to solr using any of the below three types of filters

  1. StempelPolishStemFilterFactory

  2. HunspellStemFilterFactory

  3. MorfologikFilterFactory

The first and third was not working for me as it is not present in the current version of solr shipped with hybris 5.2 so I have used HunspellStemFilterFactory which the current version supports

Thanks, Ashwan

Former Member
0 Kudos

Answering my own question, We can use Hunspell which is part of lucene 4. 6 for adding Polish to schema.xml and its like

<filter class="solr.HunspellStemFilterFactory"/>