Solr 7.2 installation instance and Chinese Word Divider
Solr 7.2 installation instance and Chinese Word divider I. Installation instance 1. Create instance directory
[Root @ node004] # mkdir-p/usr/local/solr/home/jonychen
2. Copy instance configuration files
[Root @ node004] # cp/usr/local/solr/home/configsets/_ default/conf-rf/usr/local/solr/home/jonychen
3. Modify solrConfig. xml
[Root @ node004] # cp/root/solr-7.2.0/contrib-rf/usr/local/solr/home/
[Root @ node004] # cp/root/solr-7.2.0/dist-rf/usr/local/solr/home/
[Root @ node004] # vi/usr/local/solr/home/jonychen/conf/solrconfig. xml
4. Create an ECS instance on the console
Instance created
2. Install the Chinese word divider. 1. Copy the jar package.
[Root @ node004 ~] # Cd/usr/local/solr/home/contrib/analysis-extras/lucene-libs/
[Root @ node004 lucene-libs] # cp lucene-analyzers-smartcn-7.2.0.jar/usr/local/solr/apache-tomcat-8.5.24/webapps/solr/WEB-INF/lib/
2. Modify managed-schema
[Root @ node004 ~] # Cd/usr/local/solr/home/jonychen/conf
[Root @ node004 conf] # vi managed-schema
Chinese Word Divider
<!-- ChineseAnalyzer --><fieldType name="solr_cnAnalyzer" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="org.apache.lucene.analysis.cn.smart.HMMChineseTokenizerFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="org.apache.lucene.analysis.cn.smart.HMMChineseTokenizerFactory"/> </analyzer></fieldType>
Change the default tokenizer to a Chinese tokenizer.
3. Restart tomcat
[Root @ node004] #/usr/local/solr/apache-tomcat-8.5.24
[Root @ node004 apache-tomcat-8.5.24] #./bin/shutdown. sh
[Root @ node004 apache-tomcat-8.5.24] # jps
Jps 2670
[Root @ node004 apache-tomcat-8.5.24] # ps-ef | grep java
Root 2681 1988 0 00:00:00 pts/0 grep java
[Root @ node004 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.
[Root @ node004 apache-tomcat-8.5.24] # tailf./logs/catalina. out
4. Test