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
Table of contents Makefile Makefile naming and ru...
1. Common connections for mysql INNER JOIN (inner...
Optimizing large amounts of database data is a hu...
The essence of a flat website structure is simpli...
First: action is an attribute of form. HTML5 has d...
1. What is the hyperlink icon specification ?<...
01. Command Overview The paste command will merge...
Install Docker Desktop Download address: Docker D...
①. How to use the alias (CNAME) record: In the do...
Table of contents infer Case: Deepen your underst...
Table of contents Preface: 1. Install Docker 2. I...
Target Display one of the data in the iostat comm...
The method of obtaining the position of the point...
example: <html> <head> <style type...
We are not discussing PHP, JSP or .NET environmen...