solr-4.10.0, TOMCAT7, ikanalyzer2012ff_u1 Chinese word breaker integration and related configuration

Source: Internet
Author: User
Tags solr tomcat

solr-4.10.0 and TOMCAT7 Integration related configurations:

1. Create folder directory on this machine as shown in figure:



2. Copy all the information in the SOLR file under the example file in SOLR to the location you want as the server D:\solrconfig\solr\home file



3. Copy the Solr.war file in Solr-4.10.0\example\webapps to the WebApps folder in the Tomcat installation directory, run Tomcat (ignoring how to run Tomcat), Tomcat will automatically unzip the Solr.war file and delete the Solr.war file. (otherwise it will be published once every time you start Tomcat)



4. Copy the extracted Solr folder to the D:\solrconfig\solr\server file you created.



5, modify the D:\solrconfig\solr\home\collection1\conf file under the Solrconfig.xml Data index datastore location is <datadir>${solr.data.dir:d :\solrconfig\solr\home\collection1\data}</datadir>




6, in the Tomcat\conf\server.xml configuration file <Host></Host> node configuration SOLR home Directory location

<context path= "/SOLR" docbase= "D:\SOLRCONFIG\SOLR\SERVER\SOLR" debug= "0" crosscontext= "true" reloadale= "false" >

<environment name= "Solr/home" type= "java.lang.String" value= "D:\solrconfig\solr\home" override= "true" ></ Environment>

</Context>


7. If you start the Tomcat report error, missing jar



8. Copy all the jars under the extracted \solr-4.10.0\example\lib\ext to the Tomcat Lib file and restart Tomcat


9. Access through the http://localhost:8080/solr/



============= IK Analyzer 2012ff_hf1 Chinese word segmentation configuration =============

1. Import the Ikanalyzer2012ff_u1.jar into the drive letter: \solr\server\solr\web-inf\lib

(and to have commons-io-2.3.jar,commons-logging-1.1.1.jar two jars)

2, copy the IKAnalyzer.cfg.xml, stopword.dic to the core of the need to use the word breaker conf (drive letter: \solr\server\solr\web-inf\classes) below ( Note: If you do not have the Classe folder to create a classes folder yourself, it is convenient to configure your own defined thesaurus)

3. Configure the following configuration in the drive letter: \solr\home\collection1\conf\schema.xml
<fieldtype name= "Text_ik" class= "SOLR. TextField ">

<analyzer type= "index" ismaxwordlength= "false" class= "Org.wltea.analyzer.lucene.IKAnalyzer"/>


<analyzer type= "Query" ismaxwordlength= "true" class= "Org.wltea.analyzer.lucene.IKAnalyzer"/>


</fieldType>


=============ik Analyzer 2012ff_hf1 Configuring custom Thesaurus =============


1, modify the drive: \solr\server\solr\web-inf\classes folder's IKAnalyzer.cfg.xml configuration file put your own defined thesaurus file into the drive letter: \solr\server\solr\web-inf\ Classes and IKAnalyzer.cfg.xml in a directory

(Note: The Ext.dic encoding must be encode in UTF-8 without BOM, otherwise the custom Thesaurus will not be recognized if you want to configure multiple custom thesaurus, you can <entry key= "Ext_dict" >ext.dic; Mydic.dic</entry> separated by semicolons (;)
<?xml version= "1.0" encoding= "UTF-8"?
<! DOCTYPE Properties SYSTEM "Http://java.sun.com/dtd/properties.dtd" >  
<properties>  
< Comment>ik Analyzer Extended configuration </comment>
<!--the user can configure their own extension dictionary-->
<entry key= "Ext_dict" > EXT.DIC;</ENTRY>&NBSP

<!--The user can configure their own extension stop word dictionary-->
<entry key= "Ext_stopwords" > stopword.dic;</entry> 
</properties>


 

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.