solr 4.8.0 deploy

This deploy tutorial is for solr-4.8.0 on tomcat. If you want use embeded jetty, please reffer the solr official tutorial.


1. Software prepare 

(1) Install jdk7 or higher
(2) unpackage tomcat7 or higher

2. Deploy solr.war


(1) # cp ..../solr-4.8.0/solr-4.8.0/example/webapps/solr.war ..../apache-tomcat-7.0.53/webapps/

(2) start tomcat to unpackage the solr.war. Because solr.war lack some resources, we need to copy these resources into this web project.

# cp ..../solr-4.8.0/example/lib/ext/* ..../apache-tomcat-7.0.53/webapps/solr/WEB-INF/lib/
# CP ..../solr-4.8.0/example/resources/log4j.properties ..../apache-tomcat-7.0.53/webapps/solr/WEB-INF/classes/

(3) Tell solr project where is its solr home
# vim ..../apache-tomcat-7.0.53/webapps/solr/WEB-INF/web.xml

Add Entity
//
<env-entry>
    <env-entry-name>solr/home</env-entry-name>
        <env-entry-value>/home/jonathan/solr/solr-4.8.0/example/solr</env-entry-value>
        <env-entry-type>java.lang.String</env-entry-type>
</env-entry>
//

3. Add Chinese Analyzer -- PaoDing

(1) Download the paoding for lucene4.x

http://git.oschina.net/zhzhenqin/paoding-analysis

(2) Change the "paoding.dic.home" in paoding-dic-home.properties

(3) cp the dic fold from the paoding maven project to the "paoding.dic.home" path

   note: The dic folder is under the paoding project

(4) build paoding project to a jar, and copy this jar to ..../apache-tomcat-7.0.53/webapps/solr/WEB-INF/lib/

(5) Add a text FieldType base on paoding in schema.xml

# vim ${SOLR-HOME}/${CORE-NMAE}/conf/schema.xml

Add a FieldType
//
<fieldType name="text_paoding" class="solr.TextField">
  <analyzer class="net.paoding.analysis.analyzer.PaodingAnalyzer" />
  </fieldType>
  //

  (6) restart tomcat







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值