add CJKTokenizer to solr

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

add CJKTokenizer to solr

zha jimmy
hi, all

     I am try to config solr to support chinese tokenize。

     I saw the tips in schema.xml:

    <!-- One can also specify an existing Analyzer class that has a
         default constructor via the class attribute on the analyzer element
    <fieldtype name="text_greek" class="solr.TextField ">
      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
    </fieldType>
    -->

    Then I modified schema.xml

   <fieldtype name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="org.apache.lucene.analysis.cjk.CJKTokenizer "/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldtype>:

    When I start the solr there is some error Caused by:
java.lang.ClassNotFoundException:
org.apache.lucene.analysis.cjk.CJKTokenizer.

    I realized that solr do not have the CJK package ,but how can I add it
in?
Reply | Threaded
Open this post in threaded view
|

Re: add CJKTokenizer to solr

Erik Hatcher

On Jan 29, 2007, at 1:08 AM, zha jimmy wrote:

> hi, all
>
>     I am try to config solr to support chinese tokenize。
>
>     I saw the tips in schema.xml:
>
>    <!-- One can also specify an existing Analyzer class that has a
>         default constructor via the class attribute on the analyzer  
> element
>    <fieldtype name="text_greek" class="solr.TextField ">
>      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
>    </fieldType>
>    -->
>
>    Then I modified schema.xml
>
>   <fieldtype name="text" class="solr.TextField"  
> positionIncrementGap="100">
>      <analyzer>
>        <tokenizer  
> class="org.apache.lucene.analysis.cjk.CJKTokenizer "/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>      </analyzer>
>    </fieldtype>:
>
>    When I start the solr there is some error Caused by:
> java.lang.ClassNotFoundException:
> org.apache.lucene.analysis.cjk.CJKTokenizer.
>
>    I realized that solr do not have the CJK package ,but how can I  
> add it
> in?

You need to add the analyzers JAR from Lucene's contrib area to your  
Solr application, under WEB-INF/lib.  You can get that JAR from the  
latest Lucene release distribution.

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: add CJKTokenizer to solr

Chris Hostetter-3

: >    I realized that solr do not have the CJK package ,but how can I
: > add it
: > in?
:
: You need to add the analyzers JAR from Lucene's contrib area to your
: Solr application, under WEB-INF/lib.  You can get that JAR from the
: latest Lucene release distribution.

it's acctually eazier then placing it in WEB-INF/lib .. if you make a
"lib" directory in the solr home directory (same place your solr conf and
data directories are) you can put any jars that contain analyzers or other
plugins you want to use there before starting Solr and it should find them
no problem...

http://wiki.apache.org/solr/SolrPlugins


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: add CJKTokenizer to solr

Erik Hatcher
hoss++


On Jan 29, 2007, at 3:43 PM, Chris Hostetter wrote:

>
> : >    I realized that solr do not have the CJK package ,but how can I
> : > add it
> : > in?
> :
> : You need to add the analyzers JAR from Lucene's contrib area to your
> : Solr application, under WEB-INF/lib.  You can get that JAR from the
> : latest Lucene release distribution.
>
> it's acctually eazier then placing it in WEB-INF/lib .. if you make a
> "lib" directory in the solr home directory (same place your solr  
> conf and
> data directories are) you can put any jars that contain analyzers  
> or other
> plugins you want to use there before starting Solr and it should  
> find them
> no problem...
>
> http://wiki.apache.org/solr/SolrPlugins
>
>
> -Hoss

Reply | Threaded
Open this post in threaded view
|

Re: add CJKTokenizer to solr

James liu-2
he now is ok.


--
regards
jl
Reply | Threaded
Open this post in threaded view
|

Re: add CJKTokenizer to solr

zha jimmy
Thank you all, it's works now:).

2007/1/30, James liu <[hidden email]>:
>
> he now is ok.
>
>
> --
> regards
> jl
>
>