1. 程式人生 > >linux 系統安裝 solr,以及各版本的下載地址

linux 系統安裝 solr,以及各版本的下載地址

Solr是一個獨立的企業級搜尋應用伺服器,它對外提供類似於Web-service的API介面。使用者可以通過http請求,向搜尋引擎伺服器提交一定格式的XML檔案,生成索引;也可以通過Http Get操作提出查詢請求,並得到XML格式的返回結果。

Solr的目標是打造一款企業級的搜尋引擎系統,它是一個搜尋引擎服務,可以獨立執行,通過Solr可以非常快速的構建企業的搜尋引擎,通過Solr也可以高效的完成站內搜尋功能。基於Lucene的全文搜尋伺服器,同時對其進行了擴充套件,提供了比Lucene更為豐富的查詢語言,同時實現了可配置、可擴充套件並對查詢效能進行了優化,並且提供了一個完善的功能管理介面,是一款非常優秀的全文搜尋引擎。

1. solr下載安裝

這裡我們選擇6.5.0來安裝,因為博主不知道為什麼每次下載都失敗,網速也不慢,可能是apache的限制問題吧!

所以博主找了一個csdn的下載地址,版本是6.5.1。解壓後我們只用裡邊的solr-6.5.1.zip,然後解壓即可。

然後進入到解壓目錄的bin目錄,進行啟動,如下所示:

sun:bin sun$ cd /Users/sun/Documents/solr-6.5.1/bin
sun:bin sun$ ll
total 344
[email protected] 3 sun  staff     96  4 21  2017 init.d/
[email protected]
 1 sun  staff  12601  4 20  2017 install_solr_service.sh* [email protected] 1 sun  staff   1255  4 20  2017 oom_solr.sh* [email protected] 1 sun  staff   8209  4 20  2017 post* [email protected] 1 sun  staff  65037  4 20  2017 solr* [email protected] 1 sun  staff  61034  4 20  2017 solr.cmd* [email protected]
 1 sun  staff   6204  4 20  2017 solr.in.cmd* [email protected] 1 sun  staff   6950  4 20  2017 solr.in.sh* sun:bin sun$ ./solr start Waiting up to 180 seconds to see Solr running on port 8983 [\] Started Solr server on port 8983 (pid=10708). Happy searching!   sun:bin sun$

使用 ./solr start 啟動成功,我們來訪問:http://localhost:8983/solr 訪問沒問題,安裝成功!

2. 我們建立一個articles的集合(collection),collection和core是一個概念(後面我都會用collection或集合)

博主每次使用介面建立core都失敗,這裡呢,我們使用命令 ./solr create -c my_core 進行建立吧!  

sun:bin sun$ pwd
/Users/sun/Documents/solr-6.5.1/bin
sun:bin sun$ ./solr create -c my_core
 
Copying configuration to new core instance directory:
/Users/sun/Documents/solr-6.5.1/server/solr/my_core
 
Creating new core 'my_core' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=my_core&instanceDir=my_core
 
{
  "responseHeader":{
    "status":0,
    "QTime":1740},
  "core":"my_core"}
 
 
sun:bin sun$
建立完畢,重新整理solr服務,就可以看到。