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:
Install Tomcat under CentOS, no nonsense here.
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)
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