tomcat7 集成 solr4.3.1

本例使用的是:tomcat :apache-tomcat-7.0.41

                           Solr   : solr-4.3.1

 

步骤一:将下载下来的,solr-conf下的solr 文件拷贝到你机器的tomcat的webapps目录下

 

步骤二:Solr usesUTF-8 file encoding. That means that we need to ensure
that Apache Tomcat will be informed that allrequests and responses made should use that
encoding. To do that, we modified the server.xml file in the way shown in thefollowing code:

 

将你机器的tomcat的apache-tomcat-7.0.41\conf下的server.xml中在

<Connectorport="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443"/>后面添加URIEncoding="UTF-8"

 如:

<Connectorport="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443"

URIEncoding="UTF-8"/>

 

步骤三:将你下载的solr-conf目录下的tomcat need solr lib目录下的所有的lib全部拷贝到你机器的apache-tomcat-7.0.41\lib 目录下。

 

步骤四:将webapps\solr\WEB-INF\web.xml打开,修改<env-entry-value>填写你tomcat指向solr路径</env-entry-value>

<env-entry>

      <env-entry-name>solr/home</env-entry-name>

      <env-entry-value>/put/your/solr/home/here</env-entry-value>

      <env-entry-type>java.lang.String</env-entry-type>

   </env-entry>

 

如:<env-entry>

    <env-entry-name>solr/home</env-entry-name>

    <env-entry-value>E:/apache-tomcat-7.0.41/webapps/solr/solr</env-entry-value>

    <env-entry-type>java.lang.String</env-entry-type>

  </env-entry>

 

 

 

  

启动tomcat,可以看到日志信息,确认已经成功启动  打开 http://localhost:8080/solr/ 

2.solr 配置文件说明

如果需要索引自己数据库的数据:

找到solr-conf\solr\solr\collection1\conf\data-config 修改如下:

<dataSourcetype="JdbcDataSource" name="ds-1"

             driver="com.mysql.jdbc.Driver"

             url="jdbc:mysql://localhost/wjscenter"

              user="root"

             password="uniteque"/>

 

待续。。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值