来自 IT技术新闻 2018-10-26 09:25 的文章

Solr 7.2安装实例与中文分词器

Solr 7.2安装AG88平台与中文分词器
Solr 7.2安装AG88平台与中文分词器 一、安装AG88平台 1、创建AG88平台目录

[[email protected]]# mkdir -p /usr/local/鼎盛国际solr/home/jonychen

2、复制AG88平台相关配置文件

[[email protected]]# cp   /usr/local/solr/home/configsets/_default/conf   -rf    /usr/local/solr/home/jonychen

3、修改solrConfig.xml

[[email protected]]# cp  /root/solr-7.2.0/contrib -rf /usr/local/solr/home/
[[email protected]]# cp  /root/solr-7.2.0/dist -rf /usr/local/solr/home/

[[email protected]]# vi  /usr/local/solr/home/jonychen/conf/solrconfig.xml

4、  通过管理控制台创建

创建AG88平台成功AAAAAAA>

 

二、  安装中文分词器 1、复制jar包

[[email protected] ~]# cd    /usr/local/solr/home/contrib/analysis-extras/lucene-libs/

[[email protected] lucene-libs]# cp lucene-analyzers-smartcn-7.2.0.jar     /usr/local/solr/apache-tomcat-8.5.24/webapps/solr/WEB-INF/lib/

2、修改managed-schema

[[email protected] ~]# cd /usr/local/solr/home/jonychen/conf

[[email protected] conf]# vi managed-schema 

中文分词器

<!-- ChineseAnalyzer -->
<fieldType name="solr_cnAnalyzer"  positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer />
  </analyzer>
  <analyzer type="query">
    <tokenizer />
  </analyzer>
</fieldType>

 修改默认分词器为中文分词器

3、  重新启动tomcat

[[email protected]]#  /usr/local/solr/apache-tomcat-8.5.24

[[email protected] apache-tomcat-8.5.24]# ./bin/shutdown.sh

[[email protected] apache-tomcat-8.5.24]# jps
2670 Jps
[[email protected] apache-tomcat-8.5.24]# ps -ef | grep java
root 2681 1988 0 06:10 pts/0 00:00:00 grep java
[[email protected] apache-tomcat-8.5.24]# ./bin/startup.sh
Using CATALINA_BASE: /usr/local/solr/apache-tomcat-8.5.24
Using CATALINA_HOME: /usr/local/solr/apache-tomcat-8.5.24
Using CATALINA_TMPDIR: /usr/local/solr/apache-tomcat-8.5.24/temp
Using JRE_HOME: /usr/local/java/jdk1.8.0_111
Using CLASSPATH: /usr/local/solr/apache-tomcat-8.5.24/bin/bootstrap.jar:/usr/local/solr/apache-tomcat-8.5.24/bin/tomcat-juli.jar
Tomcat started.
[[email protected] apache-tomcat-8.5.24]# tailf ./logs/catalina.out

4、测试

http://www.bkjia.com/Linux/1295344.htmlwww.bkjia.comtruehttp://www.bkjia.com/Linux/1295344.htmlTechArticleSolr 7.2安装AG88平台与中文分词器 Solr 7.2安装AG88平台与中文分词器 一、安装AG88平台 1、创建AG88平台目录 [[email protected]]# mkdir -p /usr/local/solr/home/jonychen 2、复...

本文源自: AG88平台