solr3.5 整合到tomcat6中

参考:http://martin3000.iteye.com/blog/807503

1、把example/webapp/solr.war放到tomcat的webapps目录;复制Solr发行包中配置示范文件(/example/solr文件夹)到tomcat/bin目录。

2、修改tomcat6的server.xml:

<Connector port="8080" maxHttpHeaderSize="8192" 
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
enableLookups="false" redirectPort="8443" acceptCount="100" 
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" /> 

 3、启动tomcat6:到tomcat的bin下,java -jar bootstrap.jar

可能会遇到异常:org.apache.solr.common.SolrException: Error loading class 'solr.VelocityResponseWriter' 

这时:找到$solr_home\conf\solrconfig.xml,把中间(Solr 3.5.0 1554行)

 <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>注释或者disabled - enable:false即可。

4、启动tomcat6,可访问http://localhost:8080/solr

5、安装IK分词器:修改/tomcat/bin/solr/conf/scheme.xml,编辑text字段类型如下,添加到schema中:

扫描二维码关注公众号,回复: 835994 查看本文章

<fieldType name="text" class="solr.TextField"> 
       <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/> 
</fieldType>

 复制IKAnalyzer2012.jar到solr/WEB-INF/lib下。

复制配置文件IKAnalyzer.cfg.xml和ext_stopword.dic到tomcat/bin中。

 

 

猜你喜欢

转载自wujay.iteye.com/blog/1562120