Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Solr8 and ikanalyzer

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to build Solr8 and ikanalyzer, many people may not know much about it. In order to make you understand better, the editor summarized the following content for you. I hope you can get something according to this article.

The service is installed and started:

So far, the latest version is solr 8.1, download address: http://lucene.apache.org/solr/downloads.html

Decompress and upload to the server directory: / opt/module/solr

Cd / opt/module/solr/bin

Start the service:. / solr start stop the service:. / solr stop

Visit the page: ip:8983/solr

The dashboard on the page can view the relevant configuration:-Dsolr.solr.home=/opt/module/solr/server/solr is the home directory of the service.

Create a new core

Core Admin

Name: name at will

The InstanceDir instance directory is built in advance, for example: ${Dsolr.solr.home} / collection

The DataDir data directory, such as data, will automatically create a new directory: ${Dsolr.solr.home} / collection/data

2. Both Config and schema xml files must be placed under instanceDir. You can do the following:

a. Change to the solr home directory: at this point, there are the following directories

b. Copy the conf under the configsets directory to collection, cp configsets/sample_techproducts_configs/conf conllection/

Now you can create a new core in the page. The construction is as follows:

Configure ik-analyzer-solr Chinese word Separator

Download the latest version of ik-analyzer-solr at https://github.com/magese/ik-analyzer-solr

So far, the latest version 8.1.0 jar package and source code had better be downloaded.

Com.github.magese ik-analyzer 8.1.0

two。 The downloaded jar package is: ik-analyzer-8.1.0.jar copied to / opt/module/solr/server/solr-webapp/webapp/WEB-INF/lib. Note: solr-webapp is the same level directory as ${Dsolr.solr.home}.

3. Copy five files from resource under the source code src to / opt/module/solr/server/solr-webapp/webapp/WEB-INF/classes/. Note: the classes directory needs to be created, but it didn't exist.

IKAnalyzer.cfg.xml ② ext.dic ③ stopword.dic ④ ik.conf ⑤ dynamicdic.txt

4. Configure managed-schema for Solr and add an ik word splitter, with particular attention. The examples given in the official documentation are as follows

In particular, initialization errors and parameter errors will be reported when integrating ik-analyzer-8.1.0 and solr-8.1.1:

The correct examples are as follows

5. Finally, if you configure your own

If item_price is long, then type= "plong" instead of type= "long". Generally, you can add a p to the Java type, otherwise the error is as follows:

6. Finally, it's time to test:

After reading the above, do you have any further understanding of how to build Solr8 and ikanalyzer? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report