Ikanalyzer is used in solr4.9 to implement synonyms, expand the dictionary, and add pause words.

Source: Internet
Author: User
Tags solr

When solr4.9 is used, ikanalyzer is used, which has encountered many problems. Now we need to make a record for later use.

First, ikanalyzer is used to see some people in the group, but it seems that no one has updated ikanalyzer... I don't know if it is true. Let's ignore this. Next we will introduce how to use it in SOLR.

In the SOLR configuration file schema. XML, add


<!--IKAnalyzer-->   <fieldType name="text_ik" class="solr.TextField" positionIncrementGap="100">       <analyzer type="index">         <tokenizer class="org.wltea.analyzer.lucene.IKAnalyzerSolrFactory"  isMaxWordLength="false"/>         <filter class="solr.LowerCaseFilterFactory"/>       </analyzer>       <analyzer type="query">         <tokenizer class="org.wltea.analyzer.lucene.IKAnalyzerSolrFactory"  isMaxWordLength="true"/>              <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>         <filter class="solr.LowerCaseFilterFactory"/>       </analyzer>     </fieldType>
Here, the org. wltea. analyzer. Lucene. ikanalyzersolrfactory class is self-extended. I will upload ikanalyzer to the jar package later.

Synonyms.txt is in the solr_home/Didi/CONF file.

Configure extension words and extension pause words:

The content of ikanalyzer. cfg. XML is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <! Doctype properties system "http://java.sun.com/dtd/properties.dtd"> <Properties> <comment> ik analyzer Extension Configuration </comment> <! -- You can configure your own extended dictionary <Entry key = "ext_dict"> Ext. dic; </entry> --> <Entry key = "ext_dict"> mydict. dic; </entry> <! -- You can configure your own extended stopword dictionary here --> <Entry key = "ext_stopwords"> stopword. DIC; </entry> </Properties>

Jar package download path: http://pan.baidu.com/s/1kT1cysn

Ikanalyzer is used in solr4.9 to implement synonyms, expand the dictionary, and add pause words.

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.