on 09-11-2014 12:23 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
StempelPolishStemFilterFactory
HunspellStemFilterFactory
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
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"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.