Installing and configuring Windows under SOLR 4.9 (c) Support Chinese word breaker

Source: Internet
Author: User
Tags solr

First will download the extracted solr-4.9.0 directory inside to find the Lucene-analyzers-smartcn-4.9.0.jar file,

Copy it into SOLR's application D:\apache-tomcat-7.0.54\webapps\solr\WEB-INF\lib,

Note: Many articles on the web use the IK Chinese word breaker (Ik_analyzer2012_u6.jar) but in the solr-4.9.0 version, I have not been configured successfully. So you can only use the Chinese word breaker that comes with SOLR.

In the application directory back to SOLR (D:\Demos\Solr\collection1\conf)

Modify the Schema.xml so that SOLR can support Chinese participle.

1 <FieldTypename= "Text_smart"class= "SOLR." TextField "Positionincrementgap= "+">2       <Analyzertype= "Index">3       <!--Here you need to configure the main parts of speech -4         <Tokenizerclass= "SOLR." Smartchinesesentencetokenizerfactory "/>5         <!--6 <filter class= "SOLR. Stopfilterfactory "ignorecase=" true "words=" Stopwords.txt "enablepositionincrements=" true "/>7 <filter class= "SOLR. Lowercasefilterfactory "/>8          -9         <!--In this example, we'll only use synonyms at query timeTen <filter class= "SOLR. Synonymfilterfactory "synonyms=" Index_synonyms.txt "ignorecase=" true "expand=" false "/> One          - A         <Filterclass= "SOLR." Smartchinesewordtokenfilterfactory "/> -       </Analyzer> -       <Analyzertype= "Query"> the       <!--Configure here Ibid . - -         <Tokenizerclass= "SOLR." Smartchinesesentencetokenizerfactory "/> -         <!-- - <filter class= "SOLR. Stopfilterfactory "ignorecase=" true "words=" Stopwords.txt "enablepositionincrements=" true "/> + <filter class= "SOLR. Synonymfilterfactory "synonyms=" Synonyms.txt "ignorecase=" true "expand=" true "/> - <filter class= "SOLR. Lowercasefilterfactory "/> +          - A         <Filterclass= "SOLR." Smartchinesewordtokenfilterfactory "/> at       </Analyzer> - </FieldType>
Schema.xml

After saving, restart the Tomcat server and enter the URL in the Address bar: http://localhost:8080/solr/Access SOLR

See above this interface to explain the configuration Chinese word success ... Again, the Java configuration is really troublesome! I hope this illustrated tutorial online can really a little more, have a few genius to solve the Chinese word segmentation configuration. Unfortunately, the use of IK Chinese word words on the Internet is still not in the solr-4.9.0.

Related Article

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.