现在的位置: 首页 > 综合 > 正文

solr安装

2019年05月22日 ⁄ 综合 ⁄ 共 1082字 ⁄ 字号 评论关闭

solr分词器安装配置:

<fieldtype name="textComplex" class="solr.TextField" positionIncrementGap="100">
    <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="complex" dicPath="dic"/>
    </analyzer>
</fieldtype>
<fieldtype name="textMaxWord" class="solr.TextField" positionIncrementGap="100">
    <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" />
    </analyzer>
</fieldtype>
<fieldtype name="textSimple" class="solr.TextField" positionIncrementGap="100">
    <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="n:/custom/path/to/my_dic" />
    </analyzer>
</fieldtype>

在schema.xml配置文件中,field属性是配置你的什么属性是要参与分词的

solr安装:

(1)下载solr,不用教

(2)解压后将dist中的solr.war文件webapp目录下让tomcat解压,与此同时,配置tomcat的server.xml

<Context path="solr" docBase="solr" reloadable="true" debug="0" crossContext="true">
			 <Environment name="solr/home" type="java.lang.String" value="<span style="background-color: rgb(255, 0, 0);">E:\server1\webapps\solr\home</span>" override="true"/> 
</Context>

(3)将解压后的example中的slor复制出来,这个是关于solr工作的目录,比如分词,上面的value就对应着这个目录,目录中有conf,collection1,等目录

【上篇】
【下篇】

抱歉!评论已关闭.