搜尋引擎Solr環境搭建詳解

來源:互聯網
上載者:User

Solr伺服器採用java5開發的,是基於Lucene全文檢索搜尋的。

要想搭建Solr,首先進行java環境的配置,安裝對應的jdk以及tomcat,在此就不多講。

以下是在jdk1.7和tomcat1.7的環境下搭建最新版本的solr4.10.3。

具體步驟如下: 1.到官網http://lucene.apache.org/solr/mirrors-solr-latest-redir.html下載.


2.建目錄/webapps/mysolr/solr


3.解壓壓縮包solr-4.10.3,找到example下的webapps中的solr.war包,並將其解壓。


4.將解壓完的war包(solr檔案夾)拷貝到第2步建的目錄:/webapps/mysolr下


5.拷貝兩個地方的jar包到/webapps/mysolr/solr/WEB-INF/lib下

   (1)example下lib包的所有jar包

    (2)example下lib包下的ext包中的所有jar包


6.拷貝example/resource下的log4j.properties檔案到/webapps/mysolr/solr/classpath 下


7.solrhome的配置:

   先建立一個solrhome目錄:/webapps/mysolr/solrhome,然後將example/solr下的所有檔案拷貝到/webapps/mysolr/solrhome下

  然後修改設定檔/webapps/mysolr/solr/WEB-INF/web.xml,將solr/home的註解放開並配置如下:

[html]  view plain  copy <env-entry>      <env-entry-name>solr/home</env-entry-name>      <env-entry-value>/webapps/mysolr/solrhome</env-entry-value>      <env-entry-type>java.lang.String</env-entry-type>   </env-entry>  


8.把/webapps/mysolr/solr部署到tomcat下,並啟動tomcat。


以上就完成了solr環境的基本搭建,訪問http://loclhost:8080/solr  可看到如下介面:


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.