Solr4.10.4 加中文分词
ik分词插件下载地址:
https://download.csdn.net/download/u014453536/9587721
接上一教程,这个教程如何配置中文ik分词
检查schema的管理模式
配置成经典模式
<!-- 经典模式 --> <schemaFactory class="solr.ClassicIndexSchemaFactory"/>
<!--修改节点 updateRequestProcessorChain-->
<updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:true}" processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date"> <processor class="solr.LogUpdateProcessorFactory"/> <processor class="solr.DistributedUpdateProcessorFactory"/> <processor class="solr.RunUpdateProcessorFactory"/> </updateRequestProcessorChain>
解压分词工具包,把IKAnalyzer2012FF_u1.jar文件复制到lib目录见图
重命名文件managed-schema为schema.xml
增加ik分词配置
<field name="my_name" type="text_ik" indexed="true" stored="true"/>
<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>
配置好以后重启tomcat服务