![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
com.github.magese:ik-analyzer
Advanced tools
ik-analyzer for solr 7.x-8.x
适配最新版本solr 7&8;
扩展IK原有词库:
分词工具 | 词库中词的数量 | 最后更新时间 |
---|---|---|
ik | 27.5万 | 2012年 |
mmseg | 15.7万 | 2017年 |
word | 64.2万 | 2014年 |
jieba | 58.4万 | 2012年 |
jcesg | 16.6万 | 2018年 |
sougou词库 | 115.2万 | 2020年 |
将以上词库进行整理后约187.1万条词汇;
添加动态加载词典表功能,在不需要重启solr服务的情况下加载新增的词典。
关闭默认主词典请在
IKAnalyzer.cfg.xml
配置文件中设置use_main_dict
为false
。
- IKAnalyzer的原作者为林良益linliangyi2007@gmail.com,项目网站为http://code.google.com/p/ik-analyzer
- 该项目动态加载功能根据博主@星火燎原智勇的博客进行修改,其GITHUB地址为@liang68
<!-- Maven仓库地址 -->
<dependency>
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>8.5.0</version>
</dependency>
将jar包放入Solr服务的Jetty
或Tomcat
的webapp/WEB-INF/lib/
目录下;
将resources
目录下的5个配置文件放入solr服务的Jetty
或Tomcat
的webapp/WEB-INF/classes/
目录下;
① IKAnalyzer.cfg.xml
② ext.dic
③ stopword.dic
④ ik.conf
⑤ dynamicdic.txt
配置Solr的managed-schema
,添加ik分词器
,示例如下;
<!-- ik分词器 -->
<fieldType name="text_ik" class="solr.TextField">
<analyzer type="index">
<tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" conf="ik.conf"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" conf="ik.conf"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
启动Solr服务测试分词;
IKAnalyzer.cfg.xml
配置文件说明:
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
use_main_dict | boolean | 是否使用默认主词典 | true |
ext_dict | String | 扩展词典文件名称,多个用分号隔开 | ext.dic; |
ext_stopwords | String | 停用词典文件名称,多个用分号隔开 | stopword.dic; |
ik.conf
文件说明:
files=dynamicdic.txt
lastupdate=0
files
为动态词典列表,可以设置多个词典表,用逗号进行分隔,默认动态词典表为dynamicdic.txt
;lastupdate
默认值为0
,每次对动态词典表修改后请+1,不然不会将词典表中新的词语添加到内存中。lastupdate
采用的是int
类型,不支持时间戳,如果使用时间戳的朋友可以把源码中的int
改成long
即可;2018-08-23
已将源码中lastUpdate
改为long
类型,现可以用时间戳了。dynamicdic.txt
为动态词典
在此文件配置的词语不需重启服务即可加载进内存中。
以#
开头的词语视为注释,将不会加载到内存中。
8.5.0
8.4.0
8.3.1
8.3.0
IKAnalyzer.cfg.xml
增加配置项use_main_dict
,用于配置是否启用默认主词典8.2.0
8.1.1
8.1.0
8.0.0
,并支持Solr8使用7.7.1
7.7.0
7.6.0
zookeeper
进行管理#
开头的行将视为注释magese.dic
7.5.0
7.4.0
如果您在使用过程中遇到了BUG,或者有不清楚的地方,请挂ISSUE或者联系作者:magese@live.cn
如果您觉得该项目对您有帮助,请别忘记给这个项目一个star
FAQs
IK-Analyzer for solr 7-8
We found that com.github.magese:ik-analyzer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.