solr5.5 基于内置jetty配置 Ubuntu

下载地址:http://archive.apache.org/dist/lucene/solr/

在你的目录下直接解压

 tar -zxvf xxxxxx.tgz  

现在就可以直接开启solr了 bin/solr start -p 7788
happy searching 服务开启成功. 其中-p 是设置访问端口号 如果没有指定 8983为默认端口号

访问:ip:7788

创建core bin/solr create -c myCollection
上传文件: bin/post -c myCollection /home/hadoop/test -p 7788

现在你可以去页面上进行索引新增修改以及检索了

    solr自带的分词器对中文的支持并不怎么好.所以我们通常会使用第三方的分词器 我这边使用的是IK分词器.
5.5版本IK分词器下载地址:https://github.com/EugenePig/ik-analyzer-solr5

具体配置参见: https://github.com/EugenePig/ik-analyzer-solr5

mmseg4j-solr配置参见:https://github.com/chenlb/mmseg4j-solr/wiki

<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="/home/hadoop/solr-5.5.2/server/solr/ikCollection/my_dic" />
    </analyzer>
</fieldtype>

原文地址:https://www.cnblogs.com/tangtianfly/p/5669099.html