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
By default, processes in the container run with r...
The content of the written Dockerfile is: FROM py...
For some systems with large amounts of data, the ...
Table of contents 1. Use SVG 2. Use fontAwesome 3...
Authorization is to grant certain permissions to ...
Some time ago, I needed to use pip downloads freq...
The span tag is often used when making HTML web p...
Table of contents Achieve results Available plugi...
Indexing is similar to building bibliographic ind...
Table of contents Overview What is Image Compress...
Detailed explanation of creating MySql scheduled ...
Table of contents 1. What is multi-instance 2. Pr...
I think the carousel is a relatively important po...
This article mainly introduces how to specify par...
Table of contents Let's talk about flattening...