將solr,solr-4.7.2復制到某一路徑下,比如F盤根目錄。
1、tomcat中進行配置,配置如下:
<Context docBase="F:/solr" reloadable="true" >
<Environment name="solr/home" type="java.lang.String" value="F:/solr-4.7.2/example/solr" override="true" />
</Context>
將tomcat啟動,啟動solr服務器,就可以進行索引創建及查詢了。
2、東方通TongWeb5.0中進行配置。配置如下:
a、東方通安裝目錄下 **\TongWeb5.0\config\twns.xml 的<deployments></deployments>標簽中間添加
<web-app context-root="solr" name="solr" source-path="F:\solr" />
b、solr主目錄配置: F:\solr\WEB-INF\web.xml 中加入
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>F:\solr-4.7.2\example\solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
3、東方通TongWeb6.0中進行配置,配置如下:
a、把solr1\solr-4.7.2\dist\solr-4.7.2.war包復制到TongWeb6.0\autodeploy目錄下
b、在TongWeb6.0\bin\tongweb.xml文件里添加:
<web-app name="solr-4.7.2" original-location="D:\TongWeb6.0\autodeploy\solr-4.7.2.war"
location="${tongweb.app}\solr-4.7.2" context-root="/solr-4.7.2" vs-names="server" is-directory="false" enabled="true" description="autodeploy---solr-4.7.2.war" deploy-order="100" object-type="user" jsp- compile="false" dtd-validate="false" is-autodeploy="true" version="" retire-state="none" retire-strategy="nature" retire-timeout="0" version-serial-number="1"/>
指定war位置和系統訪問路徑。
c、將solr1\solr-4.7.2\example\目錄下的solr文件夾復制到TongWeb6.0\bin下
d、點擊TongWeb6.0\bin\startserver.bat運行TongWeb,在命令框中會出現缺少class的錯誤。這時候操作下一步。
e、將solr1\solr-4.7.2\dist文件下的有關solr的jar包復制到TongWeb6.0\lib目錄