Es创建索引mapping时报错:Root mapping definition has unsupported parameters: [doc 原创 2021-03-02 14:20 阅读(3692)次 #### 异常问题 es7.x版本创建索引报如下错误:Root mapping definition has unsupported parameters: [doc 具体信息如下: ```json { "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "Root mapping definition has unsupported parameters: [doc : {dynamic=false, properties={last_event_time={format=yyyy-MM-dd HH:mm:ss, type=date}, storage_date={format=yyyy-MM-dd, type=date}, create_time={format=yyyy-MM-dd HH:mm:ss, type=date}, pid={type=keyword}, appear_num={type=integer}, id={type=long}, ape_id={type=keyword}, event_time={format=yyyy-MM-dd, type=date}}}]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [doc : {dynamic=false, properties={last_event_time={format=yyyy-MM-dd HH:mm:ss, type=date}, storage_date={format=yyyy-MM-dd, type=date}, create_time={format=yyyy-MM-dd HH:mm:ss, type=date}, pid={type=keyword}, appear_num={type=integer}, id={type=long}, ape_id={type=keyword}, event_time={format=yyyy-MM-dd, type=date}}}]", "caused_by" : { "type" : "mapper_parsing_exception", "reason" : "Root mapping definition has unsupported parameters: [doc : {dynamic=false, properties={last_event_time={format=yyyy-MM-dd HH:mm:ss, type=date}, storage_date={format=yyyy-MM-dd, type=date}, create_time={format=yyyy-MM-dd HH:mm:ss, type=date}, pid={type=keyword}, appear_num={type=integer}, id={type=long}, ape_id={type=keyword}, event_time={format=yyyy-MM-dd, type=date}}}]" } }, "status" : 400 } ``` 我的创建索引语句如下: ```json PUT test { "settings": { "number_of_shards": 20, "number_of_replicas": 1 }, "mappings": { "doc": { "dynamic": "false", "properties": { "id": { "type": "long" }, "pid": { "type": "keyword" }, "appear_num": { "type": "integer" }, "ape_id": { "type": "keyword" }, "last_event_time": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss" }, "storage_date": { "type": "date", "format": "yyyy-MM-dd" }, "event_time": { "type": "date", "format": "yyyy-MM-dd" }, "create_time":{ "type": "date", "format": "yyyy-MM-dd HH:mm:ss" } } } } } ``` #### 解决办法 上面问题有提到参数doc不支持,后面我反应过来才想起es7.0版本之后不再需要type doc,把上面语句中的doc删掉,再运行就可以创建索引了。 语句如下: ```json PUT test { "settings": { "number_of_shards": 20, "number_of_replicas": 1 }, "mappings": { "dynamic": "false", "properties": { "id": { "type": "long" }, "pid": { "type": "keyword" }, "appear_num": { "type": "integer" }, "ape_id": { "type": "keyword" }, "last_event_time": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss" }, "storage_date": { "type": "date", "format": "yyyy-MM-dd" }, "event_time": { "type": "date", "format": "yyyy-MM-dd" }, "create_time":{ "type": "date", "format": "yyyy-MM-dd HH:mm:ss" } } } } ``` elasticsearch 异常处理 上一篇:docker构建体积较小的jdk镜像 下一篇:Es 7.x版本批量写入数据路由字段报错:Action/metadata line [1] contains an unknown parameter [_routing]
相关文章 Es 7.x版本批量写入数据路由字段报错:Action/metadata line [1] contains an unknown parameter [_routing](1478) elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(7948) java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener(877) solr搜索报错:Error from server at http://127.0.0.1:8983/solr/索引名: undefined field text(3159) windows nginx启动报错bind() to 0.0.0.0:80 failed (1492) 记一次maven报错解决:Failed to read artifact descriptor for com.aliyun.openservices:aliyun-openservices:jar:2.0.0-OTS(4027) Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect(731) Caused by: java.net.BindException: Address already in use: connect(1624) seata并发测试报错:get global lock fail, xid:192.168.64.1:18091:2025291279, lockKeys:stock_info:1(4317) 解决java.lang.OutOfMemoryError: unable to create new native thread (587) 推荐文章 elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(7948) 聊聊数据保存到MySQL后数据乱码的问题(1078) solr时区设置解决时间多8小时问题(2235) linux下MySQL5.7.18安装过程(1052) linux下MySQL5.6.2安装过程(1067) spring cloud+feign+mybatis中使用seata0.9实现分布式事务(5155) spring cloud gateway报错Only one connection receive subscriber allowed(2821) spring cloud中Feign调用诡异报错MethodNotAllowed: status 405 reading(6200) 使用spring4实现websocket连接(2024) jquery对象与dom对象互转(1029) 热门文章 clickhouse如何删除数据(25378) redis报错远程主机强迫关闭了一个现有的连接以及超时问题(11915) clickhouse清空表数据(9698) elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(7946) clickhouse执行查询内存超出限制问题:Memory limit (total) exceeded(7891) clickhouse如何修改字段名(6137) docker中启动elasticsearch报错:Error opening log file 'logs/gc.log': Permission denied(4640) druid执行clickhouse报错:sql injection violation, dbType clickhouse , druid-version 1.2.2, syntax error(4486) clickhouse如何删除数据库和创建数据库以及分布式DDL创建数据库(4067) postgresql生成uuid(3778) 标签列表 java 微服务 java基础 异常处理 mysql spring cloud spring boot clickhouse elasticsearch linux feign spring postgresql docker js nginx seata solr gateway redis maven canal 大数据分析 dubbo 分布式事务 jdbc 架构 数据库 rocketmq select2 springmvc websocket win10 消息队列 git hadoop html jenkins mybatis quartz 开发工具 数据库集群 小程序 电脑 分布式 笔记 zookeeper xheditor 设计模式 阿里云 activemq ajax bat eclipse freemarker gitlab hibernate http hystrix javamail jquery jvm redission redission对象 springmail svn ueditor