`
mywebcode
  • 浏览: 999066 次
文章分类
社区版块
存档分类
最新评论

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"/>

待续。。。。。。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics