Can't use ICUTokenizerFactory in Solr

I am trying to use ICUTokenizerFactory in Solr schema. This is how I defined field

and fieldType

.

<fieldType name="text_icu" class="solr.TextField" positionIncrementGap="100">
    <analyzer>
        <tokenizer class="solr.ICUTokenizerFactory"/>
    </analyzer>
</fieldType>

<field name="fld_icu" type="text_icu" indexed="true" stored="true"/>

      

And when I run Solr I get this error

Plugin init failure for [schema.xml] fieldType "text_icu": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.ICUTokenizerFactory'

      

I have searched for this with no success. I don't know if I have something or if there is some problem in the circuit. If anyone has tried ICUTokenizerFactory please advise what could be the problem.

+3


source to share


2 answers


From the Wiki:



Lucene provides support for segmenting these languages ​​into syllables using the solr.ICUTokenizerFactory in the parse-extra module. To use this tokenizer see the solr / contrib / analysis-extras / README.txt file for instructions on which jars to add to your SOLR_HOME / lib file

+6


source


Add this at the top of your solrconfig.xml file:

<config>
  <lib dir="${user.dir}/../contrib/analysis-extras/lucene-libs/" />
  <lib dir="${user.dir}/../contrib/analysis-extras/lib/" />

      



It assumes that you are working from the examples directory with the solr.solr.home parameter set to your instance. Otherwise, just use the absolute path to your Solr installation.

You can also copy all these jars to the lib directory (under your kernel, not with solr home). But above is the easier way.

+8


source







All Articles