一:solr单点安装
1、下载:http://archive.apache.org/dist/lucene/solr
solr-5.5.0.tgz
2、解压到指定目录:tar -zxvf solr-5.5.0.tgz -C /usr/local/
3、将安装/usr/local/solr-5.5.0/server/solr-webapp部署到tomcat7中
4、新建目录:/usr/local/solr-5.5.0/solr_home
5、cp -r /usr/local/solr-5.5.0/server/solr/configsets/basic_configs/conf /usr/local/solr-5.5.0/solr_home
6、启动tomcat
二:中文分词器安装
https://github.com/EugenePig/ik-analyzer-solr5
# Installation # - JDK8 > mvn clean install - JDK7 > mvn clean -Djavac.src.version=1.7 -Djavac.target.version=1.7 install copy ik-analyzer-solr5-5.x.jar to server/solr-webapp/webapp/WEB-INF/lib # Configuration # <fieldType name="text_ik" class="solr.TextField"> <analyzer type="index"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" /> </analyzer> <analyzer type="query"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" /> </analyzer> </fieldType> or <fieldType name="text_ik" class="solr.TextField"> <analyzer type="index" useSmart="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/> <analyzer type="query" useSmart="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/> </fieldType>