solr5.0 Integrated mmseg4j Word breaker

Source: Internet
Author: User
Tags solr

After all, IK can't keep up with the search engine steps ah, used to be used to IK suddenly solr5.0 but there is no corresponding version (maybe I did not find it). Here first with mmesg4j instead, feel good, integration process super simple, a few steps will be done:

1. Enter the/tomcat/webapps/solr/web-inf/lib directory and put Mmseg4j-solr-2.3.0.jar and Mmseg4j-core-1.10.0.jar in

2, enter the Solr/home directory, set up their own thesaurus, I here is the establishment of My_dic folder, inside put a wordsxxx.dic file on the line (note that their own thesaurus priority is not the default high).

Attached: can be mmseg4j-core-1.10.0.jar inside the default thesaurus itself to modify the line, and then not modify the source string Defpath = System.getproperty ("Mmseg.dic.path") Mmseg.dic.path decided to load the thesaurus priority, very simple, not much introduction.

3, enter the Schema.xml, add the following configuration:

<fieldtype name= "max-word-2" class= "SOLR. TextField "positionincrementgap=" >
<analyzer>
<tokenizer class= "Com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode= "Max-word" dicpath= "My_dic"/>
</analyzer>
</fieldType>

<fieldtype name= "Simple" class= "SOLR. TextField "positionincrementgap=" >
<analyzer>
<tokenizer class= "Com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode= "simple" dicpath= "My_dic"/>
</analyzer>
</fieldType>

<fieldtype name= "complex" class= "SOLR. TextField "positionincrementgap=" >
<analyzer>
<tokenizer class= "Com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode= "complex" dicpath= "My_dic"/>
</analyzer>
</fieldType>

4. Restart SOLR and get it done.

5, as for the three-word effect of the configuration file to try it out yourself, Max should use more points

solr5.0 Integrated mmseg4j Word breaker

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.