当前位置:网站首页>01. Solr7.3.1 deployment and configuration of jetty under win10 platform
01. Solr7.3.1 deployment and configuration of jetty under win10 platform
2022-07-05 14:11:00 【Full stack programmer webmaster】
What is? Solr
Solr yes Apache Next top open source project , use Java Development , It is based on Lucene Full text search server for .Solr Provides a ratio Lucene Richer query language , At the same time, configurable 、 Scalable , And index 、 Search performance optimized
Solr Can run independently , Running on the Jetty、Tomcat Such as these Servlet In the container ,Solr The implementation of index is very simple , use POST Method direction Solr Server sends a description Field And its contents XML file ,Solr according to xml Document add 、 Delete 、 Update index .Solr Search only needs to be sent HTTP GET request , Then on Solr return Xml、json Analysis of query results in equal format , Organize page layout .Solr Build not available UI The function of ,Solr Provides a management interface , Query through the management interface Solr Configuration and operation of .
solr Is based on lucene Develop enterprise search server , It's actually encapsulation lucene.
Solr Is an independent enterprise search application server , It is similar to Web-service Of API Interface . The user can go through http request , Submit a file in a certain format to the search engine server , Build index ; You can also make a search request , And get the return result
Solr similar webservice, Call interface , Realize increase , modify , Delete , Query index library .
Solr And Lucene The difference between
Lucene Is an open source full-text search engine toolkit , It is not a complete full-text search engine ,Lucene Provides a complete query engine and index engine , The goal is to provide software developers with an easy-to-use toolkit , In order to facilitate the realization of full-text retrieval in the target system , Or with Lucene Build a full-text search engine based on .
Solr The goal is to build an enterprise level search engine system , It's a search engine service , Can run independently , adopt Solr Can be very fast to build enterprise search engine , adopt Solr It can also efficiently complete the search function in the station .
Solr similar webservice, Provide the interface , Call interface , Send some characteristic statements , Realize increase , Delete , modify , Inquire about .
1、solr Download and install
Download address : http://www.apache.org/dyn/closer.lua/lucene/solr/7.3.1
2 install solr
After downloading , take solr-7.3.1.zip Send it under your specific drive letter . But be careful that this directory had better not have spaces , Chinese or other special characters .
3、 start-up solr
decompression solr-7.3.1.zip after , Enter its bin Catalog : In the blanks shift+ Right mouse button , Get into Powershell window :
Then input cmd.exe
solr 7.3 Bring their own jetty, Can run independently , No need to use Tomcat start-up .
Input solr.cmd start Then knock back , You can start it solr 了 . The default port is :8983
Type in the browser localhost:8983/solr, You can see that solr It's already started
4、 Create the core core
So-called core By analogy mysql Database to understand , like mysql One by one database , A warehouse for storing specific data tables .
Remember that you cannot directly use the add core To create core
In the window just opened , Input solr.cmd create -c test_Core
At this point, enter server\solr, You can see that a test_Core Catalog
Enter this directory
After creation , Refresh the page , At the same time, in the drop-down box in the figure, you can see the Core 了 . If you can't see it , stay dos Window type solr restart -p 8983 restart solr that will do
Click on myCore You can see the following information : This information includes the word breaker , And data import , Data query and other functions
5、 start-up solr And the creation of core When it's done , This step configures the Chinese word splitter :
Add Chinese word segmentation plug-in :solr 7.3.1 Chinese word segmentation plug-in comes with , take solr-7.3.1\contrib\analysis-extras\lucene-libs\lucene-analyzers-smartcn-7.3.1.jar Copied to the solr-7.3.1\server\solr-webapp\webapp\WEB-INF\lib Directory
Paste to the target path :
Configure Chinese word segmentation , modify solr-7.3.1\server\solr\test_Core**【 This test_Core It was just created core name 】**\conf\managed-schema file , Add Chinese word segmentation
file location :
After opening this file , Search for Italian, stay Italian Add our Chinese configuration ( Copy and paste ):
<!-- Italian --> <!-- Configure Chinese word breaker --> <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>
Configuration complete :
Use solr restart -p 8983 restart solr service
Refresh to open the management page
Test Chinese word breaker :
6 、 Configure Chinese word breaker IK-Analyzer-Solr7
Adapt to the latest version solr7, And add the function of dynamically loading dictionary table ;
No restart is required solr Load the new dictionary in the case of service .
To download solr7 Version of ik Word segmentation is , Download address :http://search.maven.org/#search%7Cga%7C1%7Ccom.github.magese
Word segmentation is GitHub Source code address :https://github.com/magese/ik-analyzer-solr7
GitHub There is a way to use the word separator
Will download okay jar Put in bags solr-7.3.1/server/solr-webapp/webapp/WEB-INF/lib Directory
And then to solr-7.3.1/server/solr/test_Core/conf Open... In the directory managed-schema file , Add the following configuration
<!-- ik Word segmentation is --> <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>
take gitHub Download the original code resources In the catalog 5 Configuration files are put into solr Service jetty or tomcat Of webapp/WEB-INF/classes/ Under the table of contents ( If WEB-INF Under no classes Catalog , Then create it manually );
①IKAnalyzer.cfg.xml
②ext.dic
③stopword.dic
④ik.conf
⑤dynamicdic.txt
ext.dic To expand the dictionary ;
stopword.dic Dictionary for stop words ;
IKAnalyzer.cfg.xml For profile .
Each word is on a separate line
Restart again after configuration solr service
Participle test
For me, , yes , No more ( Because in stopword.dic Stop words are configured in the dictionary ).
thus .Solr Configuration complete .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/111283.html Link to the original text :https://javaforall.cn
边栏推荐
- Convolutional Neural Networks简述
- 别不服气。手机功能升级就是强
- TDengine 社区问题双周精选 | 第三期
- 让秒杀狂欢更从容:大促背后的数据库(下篇)
- WebRTC的学习(二)
- 展现强大。这样手机就不会难前进
- 魅族新任董事長沈子瑜:創始人黃章先生將作為魅族科技產品戰略顧問
- 怎么叫一手一机的功能方式
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses the coef function to obtain the log odds ratio corresponding to each vari
- mysql 自定义函数 身份证号转年龄(支持15/18位身份证)
猜你喜欢
tidb-dm报警DM_sync_process_exists_with_error排查
锚点导航小demo
LeetCode_2(两数相加)
非技术部门,如何参与 DevOps?
Why do I support bat to dismantle "AI research institute"
让秒杀狂欢更从容:大促背后的数据库(下篇)
瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿
What is the future development trend of neural network Internet of things
昆仑太科冲刺科创板:年营收1.3亿拟募资5亿 电科太极持股40%
Lepton 无损压缩原理及性能分析
随机推荐
C - Divisors of the Divisors of An Integer Gym - 102040C
鏈錶(簡單)
登录界面代码
2022 driller (drilling) examination question bank and simulation examination
After the microservice project is deployed, static resources and files uploaded to upload cannot be accessed. Solution
金融壹账通香港上市:市值63亿港元 叶望春称守正笃实,久久为功
R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用coef函数获取模型中每个变量(自变量改变一个单位)对应的对数优势比(log odds ratio)
Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting
The simplest way to open more functions without certificates
蓝桥杯学习2022.7.5(上午)
C - Divisors of the Divisors of An Integer Gym - 102040C
01 、Solr7.3.1 在Win10平台下使用jetty的部署及配置
让秒杀狂欢更从容:大促背后的数据库(下篇)
基于伯努利原理的速度监测芯片可用于天然气管道泄露检测
Laravel - model (new model and use model)
R language ggplot2 visual density map: Visual density map by group and custom configuration geom_ The alpha parameter in the density function sets the image transparency (to prevent multiple density c
Convolutional Neural Networks简述
TiFlash 面向编译器的自动向量化加速
matlab学习2022.7.4
Scenario based technology architecture process based on tidb - Theory