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.