ElasticSearch6.5.0 Rejecting mapping update to [posts] as the final mapping would have more than 1 (

Posted 小LUA

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ElasticSearch6.5.0 Rejecting mapping update to [posts] as the final mapping would have more than 1 (相关的知识,希望对你有一定的参考价值。

今天想在一个Index上增加一个type,结果报错

java.lang.IllegalArgumentException: Rejecting mapping update to [posts] as the final mapping would have more than 1 type: [doc, IT]
    at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:451) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:399) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:331) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:313) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:229) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:639) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:268) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:198) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:133) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:624) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:244) ~[elasticsearch-6.5.0.jar:6.5.0]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:207) ~[elasticsearch-6.5.0.jar:6.5.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_161]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_161]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]

 

查看官方才发现6.X不支持一个index多个type了

在6.0.0或者更高版本中仅支持单Mapping。对于5.X版本中多个Mapping依旧可以使用。计划在7.0.0中完全移除Mapping【移除是符合情理的,你看现在就只支持单Mapping,跟直接访问index没啥区别了】

 https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html

以上是关于ElasticSearch6.5.0 Rejecting mapping update to [posts] as the final mapping would have more than 1 (的主要内容,如果未能解决你的问题,请参考以下文章

elasticsearch6.5.0安装搭建以及kibana,cerebro,head,beat

ElasticSearch6.5.0 Rejecting mapping update to [posts] as the final mapping would have more than 1 (

Elasticsearch实现跨集群复制功能?

Spring Data Version兼容性VS Elasticsearch版本兼容性

如何在页面取得bindresult.reject的错误

Angular 的 $q.reject() 与 deferred.reject()