windows下solr7.9+tomcat7環境搭建

來源:互聯網
上載者:User

標籤: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環境搭建

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.