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 install and configure Solr 4 and IKAnalyzer

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces Solr 4 and IKAnalyzer how to install the configuration, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

1. JDK 1.5 + and Tomcat are the necessary environments for solr to run.

Download Solr to get solr-4.10.2.tgz http://lucene.apache.org/solr/

3. Installation:

1. Decompress solr-4.10.2.tgz

Tar-zxvf solr-4.10.2.tgz gets the solr-4.10.2 directory

2. Copy solr-4.10.2/example/webapps/solr.war to the webapps directory of Tomcat, and start Tomcat (decompress solr.war).

3. Create a solr_home directory anywhere:

(e. G. apache-tomcat-7.0.56/webapps/solr/solr_home)

4. Modify web.xml in tomcat's solr project and add the following configuration (apache-tomcat-7.0.56/webapps/solr/WEB-INF/web.xml)

Configure the address of solr home:

Solr/home apache-tomcat-7.0.56/webapps/solr/solr_home java.lang.String

5. In the unzipped solr-4.10.2 directory as follows

Solr-4.10.2/example/solr/

Copy all the contents into solr_home

6. Add all the jar packets in the following address

Solr-4.10.2/example/lib/ext

Copy to

Apache-tomcat-7.0.56/webapps/solr/WEB-INF/lib

Start Tomcat.

Access: http://localhost:8080/solr goes to the management interface

4. Integrate ikanalyzer Chinese word Separator

1. Download IK Analyzer and decompress it to get the following directory structure:

2. Copy the IKAnalyzer2012FF_u1.jar package to

Apache-tomcat-7.0.56/webapps/solr/WEB-INF/lib

Add IKAnalyzer.cfg.xml, stopword.dic copy to

Apache-tomcat-7.0.56/webapps/solr/WEB-INF/classes

(if you don't have this directory, please create it yourself.)

3. Modify (apache-tomcat-7.0.56/webapps/solr/solr_home/collection1/conf/schema.xml)

Add the following configuration:

Change the type of the field that needs to be participle with ik to the name value defined above

Text_ik

When the configuration is complete, restart tomcat.

The effect is as follows, which indicates that the installation is successful!

Thank you for reading this article carefully. I hope the article "how to install and configure Solr 4 and IKAnalyzer" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Servers

Wechat

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

12
Report