solr5.3.1 集成IK中文分词器

简介: 参考文章:http://www.cnblogs.com/sword-successful/p/5604541.html转载文章:http://www.cnblogs.com/pazsolr/p/5796813.html1.下载IK分词器包。链接:http://pan.baidu.com/s/1i4D0fZJ 密码:bcen2.解压并把IKAnalyzer5.3.1.jar 、IK-

参考文章:http://www.cnblogs.com/sword-successful/p/5604541.html

转载文章:http://www.cnblogs.com/pazsolr/p/5796813.html


1.下载IK分词器包。

链接:http://pan.baidu.com/s/1i4D0fZJ 密码:bcen

2.解压并把IKAnalyzer5.3.1.jar 、IK-Analyzer-extra-5.3.1.jar拷贝到tomcat/webapps/solr/WEB-INF/lib下。

3.修改schema.xml配置文件,如下:

修改后的配置文件

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <?xml version="1.0" encoding="UTF-8" ?>  
  2. <schema name="example" version="1.5">  
  3.    <field name="_version_" type="long" indexed="true" stored="true"/>  
  4.    <field name="_root_" type="string" indexed="true" stored="false"/>  
  5.    <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />   
  6.    <field name="title" type="text_ik" indexed="true" stored="true" multiValued="true"/>  
  7.    <field name="subject" type="text_ik" indexed="true" stored="true"/>  
  8.    <field name="description" type="text_ik" indexed="true" stored="true"/>  
  9.    <field name="text" type="text_ik" indexed="true" stored="false" multiValued="true"/>  
  10.     
  11.    <uniqueKey>id</uniqueKey>  
  12.     
  13.    <copyField source="title" dest="text"/>  
  14.    <copyField source="subject" dest="text"/>  
  15.    <copyField source="description" dest="text"/>  
  16.     
  17.    <fieldType name="string" class="solr.StrField" sortMissingLast="true" />  
  18.    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>  
  19.    <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>  
  20.       
  21.    <fieldType name="text_ik" class="solr.TextField">  
  22.     <analyzer type="index" useSmart="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/>     
  23.     <analyzer type="query" useSmart="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/>     
  24.    </fieldType>  
  25.      
  26.    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">  
  27.       <analyzer type="index">  
  28.         <tokenizer class="solr.StandardTokenizerFactory"/>  
  29.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />  
  30.         <filter class="solr.LowerCaseFilterFactory"/>  
  31.       </analyzer>  
  32.       <analyzer type="query">  
  33.         <tokenizer class="solr.StandardTokenizerFactory"/>  
  34.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />  
  35.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>  
  36.         <filter class="solr.LowerCaseFilterFactory"/>  
  37.       </analyzer>  
  38.    </fieldType>  
  39. </schema>  

 修改完成之后保存并重启solr服务器。
目录
相关文章
|
5月前
|
自然语言处理 搜索推荐 关系型数据库
淘东电商项目(47) -商品搜索服务功能的实现(集成拼音分词器)
淘东电商项目(47) -商品搜索服务功能的实现(集成拼音分词器)
47 0
|
自然语言处理 网络协议 Java
【Docker+springboot】集成部署ES+Kibana+IK(下)
【Docker+springboot】集成部署ES+Kibana+IK(下)
143 0
|
SQL 自然语言处理 API
【Docker+springboot】集成部署ES+Kibana+IK(中)
【Docker+springboot】集成部署ES+Kibana+IK(中)
79 0
|
JSON 关系型数据库 MySQL
【Docker+springboot】集成部署ES+Kibana+IK(上)
【Docker+springboot】集成部署ES+Kibana+IK(上)
123 0
|
15天前
|
消息中间件 Java Kafka
Springboot集成高低版本kafka
Springboot集成高低版本kafka
|
22天前
|
NoSQL Java Redis
SpringBoot集成Redis解决表单重复提交接口幂等(亲测可用)
SpringBoot集成Redis解决表单重复提交接口幂等(亲测可用)
75 0
|
27天前
|
NoSQL Java Redis
SpringBoot集成Redis
SpringBoot集成Redis
188 0
|
1月前
|
NoSQL Java Redis
小白版的springboot中集成mqtt服务(超级无敌详细),实现不了掐我头!!!
小白版的springboot中集成mqtt服务(超级无敌详细),实现不了掐我头!!!
253 1

热门文章

最新文章