Es创建索引mapping时报错:Root mapping definition has unsupported parameters: [doc 原创 2021-03-02 14:20 阅读(8447)次 #### 异常问题 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](3590) elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(10515) Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect(2657) java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener(1195) 记一次maven报错解决:Failed to read artifact descriptor for com.aliyun.openservices:aliyun-openservices:jar:2.0.0-OTS(5641) solr搜索报错:Error from server at http://127.0.0.1:8983/solr/索引名: undefined field text(5187) windows nginx启动报错bind() to 0.0.0.0:80 failed (1949) 解决java.lang.OutOfMemoryError: unable to create new native thread (3055) Caused by: java.net.BindException: Address already in use: connect(2782) seata并发测试报错:get global lock fail, xid:192.168.64.1:18091:2025291279, lockKeys:stock_info:1(7540) 推荐文章 elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(10515) 聊聊数据保存到MySQL后数据乱码的问题(1611) solr时区设置解决时间多8小时问题(2854) linux下MySQL5.7.18安装过程(1865) linux下MySQL5.6.2安装过程(1712) spring cloud+feign+mybatis中使用seata0.9实现分布式事务(6614) spring cloud gateway报错Only one connection receive subscriber allowed(4973) spring cloud中Feign调用诡异报错MethodNotAllowed: status 405 reading(8440) 使用spring4实现websocket连接(2683) jquery对象与dom对象互转(1509) 热门文章 clickhouse如何删除数据(39027) clickhouse清空删除表数据(17623) redis报错远程主机强迫关闭了一个现有的连接以及超时问题(15630) clickhouse执行查询内存超出限制问题:Memory limit (total) exceeded(13859) elasticsearch7.1保存时报错: Validation Failed: 1: type is missing;(10515) clickhouse如何修改字段名(9549) druid执行clickhouse报错:sql injection violation, dbType clickhouse , druid-version 1.2.2, syntax error(8568) Es创建索引mapping时报错:Root mapping definition has unsupported parameters: [doc(8446) Clickhouse批量删除分区(8075) postgresql生成uuid(7856) 标签列表 java java基础 微服务 异常处理 mysql spring boot spring cloud clickhouse elasticsearch linux feign jdbc js spring postgresql docker nginx seata gateway maven solr hsqldb canal dubbo 数据库 redis 大数据分析 分布式事务 架构 quartz rocketmq select2 win10 mybatis jenkins html springmvc hadoop git 消息队列 websocket xheditor 分布式 zookeeper 小程序 开发工具 数据库集群 电脑 笔记 设计模式 阿里云 activemq ajax bat eclipse freemarker gitlab hibernate http hystrix javamail jquery jvm redission redission对象 springmail svn ubuntu ueditor