Elasticsearch索引:文档映射类型名称不能以'_'开头,找到:[_ doc]“}}
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch索引:文档映射类型名称不能以'_'开头,找到:[_ doc]“}}相关的知识,希望对你有一定的参考价值。
当我尝试通过以下方式索引我的弹性搜索:
php artisan elastic:index
我收到以下错误:
start with '_', found: [_doc]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:297) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:640) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:270) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:195) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:130) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) [elasticsearch-6.0.0.jar:6.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
我在互联网上看到了很多,但从来没有一个明确的解释..我怎么能解决这个问题?
我正在使用Elasticsearch6.0.0
答案
您只需升级到ES 6.x.在该版本之前,不允许创建一个以下划线作为第一个字符的映射类型,除了_default_
之外。
以上是关于Elasticsearch索引:文档映射类型名称不能以'_'开头,找到:[_ doc]“}}的主要内容,如果未能解决你的问题,请参考以下文章
ElasticSearch7.3 学习之定制动态映射(dynamic mapping)
Elasticsearch 解释错误 - 文档映射类型名称不能以“_”开头