Solr4.9.1 configuration installation in Linux environment

Source: Internet
Author: User

Operating environment: CentOS6.4 Tomcat7.0 JDK1.7

Software version:

solr-4.9.1 Download Link: http://apache.fayea.com/lucene/solr/

ik-analyzer-2012ff Download Link: Http://git.oschina.net/wltea/IK-Analyzer-2012FF

Installation steps:

  1. Install Tomcat under CentOS, no nonsense here.

  2. Copy the "Solr-4.9.1.war" file under the Solr-4.9.1/dist path to the Tomcat/webapps directory and modify the name to Solr.war.

    Copy the Solr-4.9.1/example path under the "SOLR" folder to the/usr/cloud directory. (/usr/cloud/solr/This path is the SOLR root directory)

  3. Create the file Solr.xml in the conf/catalina/localhost/directory of Tomcat and create it manually if the directory does not exist.

    The contents of the Solr.xml file are as follows:

<!--SOLR server configuration--><?xml version= "1.0" encoding= "Utf-8"? ><context docbase= "/usr/local/  Tomcat/webapps/solr.war "debug=" 0 "crosscontext=" true "> <environment name=" solr/home "type=" java.lang.String " Value= "/USR/CLOUD/SOLR" override= "true"/> </Context>

DocBase is the address of the Solr.war file, environment name does not need to be modified, and value is copied to the local path SOLR-4.9.1/EXAMPLE/SOLR.

4. Copy the solr-4.9.1 lib file into the Tomcat Tomcat/lib directory.

(1) All jar files under Solr-4.9.1\dist\solrj-lib

(2) All jar files under Solr-4.9.1\example\lib\ext

5. Install Ikanalyzer Chinese Word

(1) Place the Ikanalyzer2012ff.jar in the/tomcat/webapps/solr/web-inf/lib directory.
(2) Place the corresponding configuration file in the/usr/cloud/solr/collection1/conf directory: Ikanalyzer.cfg.xml,stopword.dic,ext.dic

   Modify the IKAnalyzer.cfg.xml file content as follows: (The dictionary is IK or self-expandable)

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE Properties SYSTEM "Http://java.sun.com/dtd/properties.dtd" > <properties> <comment>ik Analyzer Extended Configuration </comment> <!--users can configure their own extension dictionaries here--<entry key= "Ext_dict" >ext.dic;</entry> <!-- Here users can configure their own extension stop word dictionary--<entry key= "Ext_stopwords" >stopword.dic;</entry> </properties>

6. Configure ikanalyzer Chinese word segmentation

(1) Modificationschema.xml , add the following two places:

Line 182th increased:

<field name= "Name_ik" type= "Text_ik" indexed= "true" stored= "true" multivalued= "false"/>

Line No. 450 increased:

<fieldtype name= "Text_ik" class= "SOLR. TextField "> <analyzer class=" Org.wltea.analyzer.lucene.IKAnalyzer "/> </fieldType>

7. Verification

Solr4.9.1 configuration installation in Linux environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.