当前位置:网站首页>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.txtext.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
边栏推荐
- [js] basic syntax - for loop
- Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting
- [machine learning notes] how to solve over fitting and under fitting
- R语言使用ggplot2包的geom_histogram函数可视化直方图(histogram plot)
- Show strength. In this way, the mobile phone will not be difficult to move forward
- C - Divisors of the Divisors of An Integer Gym - 102040C
- 魅族新任董事长沈子瑜:创始人黄章先生将作为魅族科技产品战略顾问
- R语言ggplot2可视化密度图:按照分组可视化密度图、自定义配置geom_density函数中的alpha参数设置图像透明度(防止多条密度曲线互相遮挡)
- Hongmeng fourth training
- 2022建筑焊工(建筑特殊工种)特种作业证考试题库及在线模拟考试
猜你喜欢

Brief introduction to revolutionary neural networks

IP packet header analysis and static routing

tidb-dm报警DM_sync_process_exists_with_error排查
![[js] basic syntax - for loop](/img/7f/6ddc47c062caa7d39538f88e12b1a0.jpg)
[js] basic syntax - for loop

魅族新任董事长沈子瑜:创始人黄章先生将作为魅族科技产品战略顾问
![Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]](/img/c2/a5f5fe17a6bd1f6f9df828ddd224d6.png)
Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]

Redis如何实现多可用区?
![UE source code reading [1]--- starting with problems delayed rendering in UE](/img/fa/f33242b01e4da973fa36c2c6f23db6.png)
UE source code reading [1]--- starting with problems delayed rendering in UE

让秒杀狂欢更从容:大促背后的数据库(下篇)

Sorter evolution of ticdc 6.0 principle
随机推荐
Judge whether the variable is an array
链表(简单)
Controller in laravel framework
Some ideas about Apache mesos
-Web direction attack and defense world
故障分析 | MySQL 耗尽主机内存一例分析
Tdengine biweekly selection of community issues | phase III
Matlab learning 2022.7.4
Detailed explanation of IP address and preparation of DOS basic commands and batch processing
[buuctf.reverse] 152-154
3W原则[通俗易懂]
Selenium crawls Baidu pictures
R語言ggplot2可視化:可視化折線圖、使用theme函數中的legend.position參數自定義圖例的比特置
How to deeply understand the design idea of "finite state machine"?
What category does the Internet of things application technology major belong to
别不服气。手机功能升级就是强
Discussion on memset assignment
TDengine 社区问题双周精选 | 第三期
金融壹账通香港上市:市值63亿港元 叶望春称守正笃实,久久为功
Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting