buddyli / mmseg4j

Automatically exported from code.google.com/p/mmseg4j
Apache License 2.0
0 stars 0 forks source link

solr4.5+mmseg4j1.9.1 配置不对 #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
我的做法是这样的:
1.把mmseg4j-1.9.1下dist中的三个jar文件(analysis,core,solr)copy到Tom
cat下solr的WEB_INF里面的lib中。
2.更改solr主目录下的collection1中的conf里面的schema.xml,添加如�
��内容

fields中:
<field name="simple" type="textSimple" indexed="true" stored="true" 
multiValued="true"/>  
   <field name="complex" type="textComplex" indexed="true" stored="true" multiValued="true"/>  
   <field name="text_mmseg" type="textMaxWord" indexed="true" stored="true" multiValued="true"/>

types中:
<fieldType name="textComplex" class="solr.TextField" positionIncrementGap="100" 
>  
            <analyzer>  
               <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="complex" dicPath="D:\Code\AILab\solr-4.5.0\example\solr\collection1\data\dic"/>  
               <filter class="solr.LowerCaseFilterFactory"/>  
           </analyzer>  
       </fieldType>  

     <fieldType name="textMaxWord" class="solr.TextField" positionIncrementGap="100" >  
        <analyzer>  
            <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" dicPath="D:\Code\AILab\solr-4.5.0\example\solr\collection1\data\dic"/>  
            <filter class="solr.LowerCaseFilterFactory"/>  
        </analyzer>  
     </fieldType>  

     <fieldType name="textSimple" class="solr.TextField" positionIncrementGap="100" >  
       <analyzer>  
           <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="D:\Code\AILab\solr-4.5.0\example\solr\collection1\data\dic"/>  
           <filter class="solr.LowerCaseFilterFactory"/>  
       </analyzer>  
     </fieldType>

又加了两个copyField
<copyField source="simple" dest="text_mmseg"/>
<copyField source="complex" dest="text_mmseg"/>

3.重启Tomcat,访问solr,访问collection1,好像没有什么区别,ana
lisis也没有反应

求问我配置是不是有问题?

Original issue reported on code.google.com by dxj0...@gmail.com on 31 Oct 2013 at 8:36

GoogleCodeExporter commented 9 years ago
刚好这么天在测试几个分词工具,也是用的 solr 
4.5,不过用的是自带的example。非常顺利的配置了 
mmseg4j,dicPath 
是使用默认的。如果启动时没报错,在测试字符时也没报错��
�应该是生效了。

Original comment by camel...@gmail.com on 1 Nov 2013 at 7:05

GoogleCodeExporter commented 9 years ago
没有自定义词库,可以不使用 dicPath

可以使用 2.0.0

参考 https://github.com/chenlb/mmseg4j-solr

Original comment by chenlb2...@gmail.com on 19 May 2014 at 11:31