標籤:war post index ext pos 500錯誤 web.xml sources tty
1.下載solr。tomcat(能夠不用下載。由於solr有jetty支援)
2.solr部署到tomcat上
首先,把解壓包下的solr-4.9.0\example\solr-webapp中的war包放入到tomcat中webapp下
其次。就是把solr-4.9.0\example\lib\ext(5個)日誌包放入到D:\tomcat\webapps\solr\WEB-INF\lib下,同一時候在WEB-INF下建立classes檔案夾放入solr-4.9.0\example\resources下的jar(log4j.properties),然後改動web.xml中home檔案夾位置
最後,建立solr的home目錄,我建立在D盤下solr目錄,把solr-4.9.0\example\solr 下的全部檔案copy到該目錄下,凝視到solr啟動時載入的jar
到如今這一步,我們就能夠啟動solr了
Ik分詞器配置
IK Analyzer 2012FF_hf1.zip,將解壓後的IKAnalyzer2012FF_u1.jar放到solr-4.9.0\example\solr-webapp\webapp\WEB-INF\lib下。將IKAnalyzer.cfg.xml、stopword.dic放到solr-4.9.0\example\solr-webapp\webapp\WEB-INF\classes下。沒有classes目錄就建立一個。
(分詞器後面會有完好)
參考連結:http://www.xdps.org/2014/08/08/220/
配置基本完畢,如今就是測試分詞器,以及加入多個core,怎樣啟動solr(假設加入多個solr後,重新啟動tomcat發現是500錯誤,這個是進去到tomcat中,啟動solr。reload)
在shcema.xml中加入例如以下內容,進行測試分詞效果
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
<field name="ik" type="text_ik" indexed="true" stored="true" multiValued="false" />
注意:win環境下的安裝JDK和配置,網上非常多的不正確,事實上僅僅要配置一個就足夠了,還有注冊tomcat注冊成window服務的各種奇葩問題,多看日誌
windows下solr7.9+tomcat7環境搭建