1. Environment version Docker version 19.03.12 centos7 solr8.6.2 2. Docker installation 1. Automatically install using the official installation script curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 2. Use the domestic daocloud one-click installation command: curl -sSL https://get.daocloud.io/docker | sh 3. Install solr8.6.2 in docker 1. Pull solr in docker docker pull solr 2. Create and enable the Solr container docker run --name blog-solr -d -p 8983:8983 solr // blog-solr can be named by yourself
3. Create the core docker exec -it --user=solr blog-solr bin/solr create_core -c Ik_core
4. Browser access
5. Solr configures Chinese word segmenter 5.2 Download Ik file
5.2 Copy the configuration file docker cp ik-analyzer-8.3.0.jar blog-solr:/opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/lib/ docker cp ik-analyzer-solr7-7.x.jar blog-solr:/opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/lib/ docker cp solr-dataimporthandler-8.4.0.jar blog-solr:/opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/lib/ docker cp solr-dataimporthandler-extras-8.4.0.jar blog-solr:/opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/lib/
docker exec -it --user=root blog-solr /bin/bash cd /opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF mkdir classes exit docker cp IKAnalyzer.cfg.xml blog-solr:/opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/classes/ 5.3 IKAnalyzer.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>IK Analyzer Extended Configuration</comment> <!--Users can configure their own extended dictionary here--> <entry key="ext_dict">ext.dic;</entry> <!--Users can configure their own extended stop word dictionary here--> <entry key="ext_stopwords">stopword.dic;</entry> </properties> 5.4 Modify managed-schema docker exec -it --user=root blog-solr /bin/bash cp /opt/solr-8.6.2/contrib/analysis-extras/lucene-libs/lucene-analyzers-smartcn-8.6.2.jar /opt/solr-8.6.2/server/solr-webapp/webapp/WEB-INF/lib/ cd /var/solr/data/Ik_core/conf vim managed-schema
<!-- ik word segmenter --> <fieldType name="text_ik" class="solr.TextField"> <analyzer type="index"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" conf="ik.conf"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" conf="ik.conf"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> <fieldType name="text_cn" 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> 5.5 Modify solrconfig.xml
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">db-data-config.xml</str> </lst> </requestHandler>
exit docker restart blog-solr 4. Testing 1. Check whether the word segmenter is configured successfully 2. Test whether the word segmenter can segment words normally 3. Test the search function This is the end of this article about how to install Solr 8.6.2 in Docker and configure the Chinese word segmenter. For more information about configuring the Chinese word segmenter in Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: A detailed guide to custom directives in Vue
>>: How to query whether the mysql table is locked
1. Mathematical Functions ABS(x) returns the abso...
Preface I recently wrote a small demo. Because I ...
Table of contents 1. Install Vue scaffolding 2. C...
Table of contents 1. Introduction 2. About vue-si...
The DATE_ADD() function adds a specified time int...
A simple record of the database startup problems ...
Table of contents background Function Purpose Ide...
Using Dockerfile allows users to create custom im...
1. Experimental description In the virtual machin...
Preface Generally speaking, when we talk about Li...
1. Download MySQL URL: https://dev.mysql.com/down...
Table of contents 1. Extracting functions 2. Merg...
Table of contents 1. Introduction to FastDFS 1. I...
Time flies, and in just six days, 2013 will becom...
introduce This article is based on React + antd t...