solr加ik分词器

修改上一篇文章中D:\program\tomcat6\solrapp\solr\collection1\conf\schema.xml文件

1.在field区域添加:

<field name="ik" type="text_ik" indexed="true" stored="true"/>

2.在fieldType区域中添加:

 <!-- 加入IK 2013.4.17 start -->
        <fieldType name="text_ik" class="solr.TextField">    
        <analyzer type="index" isMaxWordLength="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/>    
        <analyzer type="query" isMaxWordLength="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/>    
        </fieldType>
         <!-- 加入IK 2013.4.17 end -->

3.重新启动tomcat

测试:

如果使用其它分词器:

加入ext.dic,stopword.dic 

原文地址:https://www.cnblogs.com/atyou/p/3026838.html