solr服務搭建

2021-07-24 20:02:58 字數 1739 閱讀 7939

一。安裝solr服務

1. 安裝jdk,安裝tomcat.

2. 解壓solr壓縮包

3. 將solr下的dist/solr.war部署到tomcat下。

4. 啟動tomcat解壓war包

5. 將example/lib/ext目錄下的所有的jar包拷貝到solr工程web-info/lib下

6. 建立solrhome目錄,將example/solr資料夾複製乙份作為solrhome.

7. 修改web.xml。修改solrhome的位置。

8. 啟動tomcat.

9. 在瀏覽器輸入http://localhost:8080/solr就可以進行訪問了。

二。 為solr配置中文分析器,自定義業務域。

將ikanalyzer依賴的jar包新增到solr專案中,把分析器使用的擴充套件字典新增到classpath中。

對solrhome/collection1/conf/schema.xml進行修改。新增自定義的filedtype.指定中文分析器。

name="text_ik"

class="solr.textfield">

class="org.wltea.analyzer.lucene.ikanalyzer"/>

fieldtype>

3.自定義域。指定域的型別的自定義的fieldtype.

在schema.xml中加入

"item_title"

type="text_ik" indexed="true" stored="true"/>

"item_sell_point"

type="text_ik" indexed="true" stored="true"/>

"item_price"

type="long" indexed="true" stored="true"/>

"item_image"

type="string" indexed="false" stored="true" />

"item_category_name"

type="string" indexed="true" stored="true" />

"item_desc"

type="text_ik" indexed="true" stored="false" />

"item_keywords"

type="text_ik" indexed="true" stored="false" multivalued="true"/>

"item_title" dest="item_keywords"/>

"item_sell_point" dest="item_keywords"/>

"item_category_name" dest="item_keywords"/>

"item_desc" dest="item_keywords"/>

4.重新啟動tomcat即可。

Solr服務的搭建

第一步 安裝jdk 安裝tomcat 第二步 解壓solr壓縮包。第三步 將原始碼包中的dist solr 4.10.3.war部署到tomcat下。第四步 啟動tomcat解壓,解壓縮war包。解壓後,刪除war包。第五步 需要把原始碼包中example lib ext目錄下的所有的jar包新增到...

solr服務搭建 詳解

1.solr所需的環境 安裝linux系統 需要安裝jdk 需要安裝tomcat 2.搭建步驟 第二步解壓solr檔案 第三部安裝tomcat 可以把壓縮包複製到linux上解壓即可 第四部 把solr部署到tomcat下面 2.然後啟動tomcat,solr.war便會自動解壓。這時solr.wa...

搭建solr伺服器

一.solr簡單介紹 1.solr是乙個全文檢索伺服器,它可以對文件進行分析然後生成索引,將索引儲存到索引庫並且也會儲存文件。使用的時候可以通過索引進行文件查詢。bin是solr執行的指令碼 contrib是solr的一些外掛程式,用於擴充套件solr的功能 dist該資料夾下包含build過程中產...