solr3.3 中文IK分词(IKAnalyzer3.2.8 bin.zip)(亲测)
1.IK下载地址
http://code.google.com/p/ik-analyzer/downloads/detail? name=IKAnalyzer3.2.8%20bin.zip&can=2&q=a
2.解压到本地目录
suse@server0:/server/bin> unzip IKAnalyzer3.2.8 bin.zip
3.将jar包放入solr工程下
suse@server0:/server/bin/IKAnalyzer> cp IKAnalyzer3.2.8.jar /server/bin/tomcat/webapps/solr/WEB-INF/lib/
4.修改solr/home 下的 solrconfig.xml
cd /usr/solr/conf
vi solrconfig.xml
<fieldType name="text" class="solr.TextField">
<analyzer type="index">
<tokenizer class="org.wltea.analyzer.solr.IKTokenizerFactory" isMaxWordLength="false"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="org.wltea.analyzer.solr.IKTokenizerFactory" isMaxWordLength="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
将IK分词集成到solr中
5.重启tomcat 验证分词(如图)
邮箱:[email protected](欢迎交流)