Solr添加IKAnalysis中文分词
<fieldType name="textik" > <analyzer isMaxWordLength="false"/> <filter ignoreCase="true" words="stopwords.txt"/> <filter generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> <filter protected="protwords.txt"/> <filter isMaxWordLength="false"/> <filter ignoreCase="true" words="stopwords.txt"/> <filter generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> <filter protected="protwords.txt"/> <filter name="code"> <fields> <field name="title" type="textik" indexed="true" stored="true" required="true" /> </fields>
?
?
3. 将下载的IKAnalyzer目录下的IKAnalyzer3.2.8.jar放入 TOMCAT/webapps/该solr工程/WEB-INFO/lib 目录下
?
4. 将下载的IKAnalyzer目录下的IKAnalyzer.cfg.xml和ext_stopword.dic文件放入 TOMCAT/webapps/该solr工程/classes 目录下,你也可以自己定义停用词字典,然后在IKAnalyzer.cfg.xml中进行配置,多个停用词字典之间用逗号隔开
?
5. 重启tomcat,输入http://域名:端口号/该solr工程/admin/analysis.jsp,效果如下:
?
?
?