当前位置:网站首页>Solr word segmentation analysis

Solr word segmentation analysis

2022-07-06 16:46:00 Daily enlightenment

stay Solr In the visual management interface ,Core There will be... In the management menu item of Analysis, Express basis Scheme.xml(managed-schema) The configuration in requires parsing .

(1) Upload jar To the specified directory

Upload ik-analyzer-7.7.0.jar To

​ /usr/local/solr/server/solr-webapp/webapp/WEB-INF/lib Directory

(2) Modify the configuration file

modify /usr/local/solr/server/solr/testcore/conf/managed-schema

# vim /usr/local/solr/server/solr/testcore/conf/managed-schema

(3) Add the following

<field name="myfield" type="text_ik" indexed="true" stored="true" />
    <fieldType name="text_ik" class="solr.TextField">
            <analyzer type="index">
                    <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" conf="ik.conf"/>
                    <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
            <analyzer type="query">
                    <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" conf="ik.conf"/>
                    <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
    </fieldType> 

(4) restart

# cd /usr/local/solr/bin
# ./solr stop -all
# ./solr start -force 

 (5) verification

Set before :

After setting :

原网站

版权声明
本文为[Daily enlightenment]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131314160927.html