analyzer [ik_smart] not found for field [name]

这篇具有很好参考价值的文章主要介绍了analyzer [ik_smart] not found for field [name]。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

springboot 集成 elasticsearch 启动服务端后,访问出现如下报错:

org.elasticsearch.index.mapper.MapperParsingException: analyzer [ik_smart] not found for field [name]
	at org.elasticsearch.index.mapper.TypeParsers.parseAnalyzersAndTermVectors(TypeParsers.java:111) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.TypeParsers.parseTextField(TypeParsers.java:200) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.TextFieldMapper$TypeParser.parse(TextFieldMapper.java:215) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:280) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:200) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:132) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:112) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:92) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:395) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:354) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:333) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:227) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:643) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:272) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:202) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:137) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:660) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:244) ~[elasticsearch-6.4.3.jar:6.4.3]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:207) ~[elasticsearch-6.4.3.jar:6.4.3]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:1.8.0_333]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:1.8.0_333]
	at java.lang.Thread.run(Thread.java:834) ~[na:1.8.0_333]

错误原因是,没有安装分词器 IK

如何安装分词器 IK

访问 https://github.com/medcl/elasticsearch-analysis-ik
点击如下图标注出的地方,选择发行的版本
ik_smart not found,elasticsearch,java,搜索引擎
点进来后,可以按下图所示的地方搜索自己想要的版本号

注:此处的版本号最好与 elasticsearch 的版本号保持一致

ik_smart not found,elasticsearch,java,搜索引擎

本文就选用 v6.6.2 版本,选择点击进入后,选择 zip 包点击下载,如下图:
ik_smart not found,elasticsearch,java,搜索引擎
下载好后解压,然后上传至 elasticsearchplugins 文件夹下,下图中的路径是本文的安装路径,请小伙伴对照自己 elasticsearch 的路径
ik_smart not found,elasticsearch,java,搜索引擎
最后使用 docker-compose up -d 命令,重新启动文章来源地址https://www.toymoban.com/news/detail-615853.html

到了这里,关于analyzer [ik_smart] not found for field [name]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包