当前位置:网站首页>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
边栏推荐
- How to introduce devsecops into enterprises?
- After the microservice project is deployed, static resources and files uploaded to upload cannot be accessed. Solution
- Make the seckill Carnival more leisurely: the database behind the promotion (Part 2)
- PHP5下WSDL,SOAP调用实现过程
- WebRTC的学习(二)
- Getting started with rce
- What are the advantages and characteristics of SAS interface
- Controller in laravel framework
- Detailed explanation of IP address and preparation of DOS basic commands and batch processing
- Anchor navigation demo
猜你喜欢
Financial one account Hong Kong listed: market value of 6.3 billion HK $Ye wangchun said to be Keeping true and true, long - term work
How to deeply understand the design idea of "finite state machine"?
Xampp configuring multiple items
瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿
Zhizhen new energy rushes to the scientific innovation board: the annual revenue is 220million, and SAIC venture capital is the shareholder
Postman简介、安装、入门使用方法详细攻略!
Embedded software architecture design - message interaction
What is the future development trend of neural network Internet of things
[js] basic syntax - for loop
TDengine 社区问题双周精选 | 第三期
随机推荐
Introduction, installation, introduction and detailed introduction to postman!
R language uses boxplot function in native package (basic import package, graphics) to visualize box plot
Selenium crawls Baidu pictures
Comparison of several distributed databases
Recommendation number | what are interesting people looking at?
Shenziyu, the new chairman of Meizu: Mr. Huang Zhang, the founder, will serve as the strategic adviser of Meizu's scientific and technological products
Some ideas about Apache mesos
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
物联网应用技术专业是属于什么类
为什么我认识的机械工程师都抱怨工资低?
Xampp configuring multiple items
In addition to the root directory, other routes of laravel + xampp are 404 solutions
JS takes key and value from an array object to form a new object
After the microservice project is deployed, static resources and files uploaded to upload cannot be accessed. Solution
LeetCode_67(二进制求和)
明峰医疗冲刺科创板:年营收3.5亿元 拟募资6.24亿
Routing in laravel framework
Deep copy is hard
国富氢能冲刺科创板:拟募资20亿 应收账款3.6亿超营收
R语言ggplot2可视化:gganimate包基于transition_time函数创建动态散点图动画(gif)、使用shadow_mark函数为动画添加静态散点图作为动画背景