java.lang.IllegalArgumentException: Limit of total fields [1000] in index 索引名称

报错问题

java.lang.IllegalArgumentException: Limit of total fields [1000] in index [clfx_qaht_ws_history_index] has been exceeded
    at org.elasticsearch.index.mapper.MapperService.checkTotalFieldsLimit(MapperService.java:604) ~[elasticsearch-5.6.10.jar:5.6.10]

    at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:420) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:336) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:268) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:311) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:634) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:612) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:571) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:263) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:575) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) ~[elasticsearch-5.6.10.jar:5.6.10]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) ~[elasticsearch-5.6.10.jar:5.6.10]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_211]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_211]
    at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_211]

 

解决方法

字面意思就是你index里面放了太多的字段了
俩建议啊,1. 找业务方和用户聊聊,哪些字段其实用不到的就别放进去了,或者在mapping的时候直接index:false
2. 换个其他的大数据解决方案做类似多维度存储和计算,比如hive啊之类之类的。

head插件中复合查询

http://ip:port/索引/_settings/

使用put请求

{

  "index": {

    "mapping.total_fields.limit": 2000

  }

}

java.lang.IllegalArgumentException: Limit of total fields [1000] in index 索引名称_第1张图片

处理完成,alt+f5属性head插件

查询对应索引信息,

java.lang.IllegalArgumentException: Limit of total fields [1000] in index 索引名称_第2张图片

你可能感兴趣的:(es)