Root mapping definition has unsupported parameters
使用ElasticSearch创建映射报错
Root mapping definition has unsupported parameters
原因
使用的ES版本为7.2.0,不再支持创建指定类型,索引的默认类型为_doc.
官网图片

解决办法
创建索引的映射时,不需要指定类型即可
错误再现
错误的创建索引语句
PUT /dangdang1
{
"mappings": {
"book":{ # 这里指定了类型type
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "keyword"
},
"price": {
"type": "double"
},
"detail": {
"type": "text"
}
}
}
}
}
报错信息
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [book : {properties={price={type=double}, name={type=keyword}, id={type=integer}, detail={type=text}}}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [book : {properties={price={type=double}, name={type=keyword}, id={type=integer}, detail={type=text}}}]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [book : {properties={price={type=double}, name={type=keyword}, id={type=integer}, detail={type=text}}}]"
}
},
"status": 400
}
正确的创建索引映射的语句
PUT /dangdang
{
"mappings": {
# 这里不再写类型
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "keyword"
},
"price": {
"type": "double"
},
"detail": {
"type": "text"
}
}
}
}
Root mapping definition has unsupported parameters的更多相关文章
- ElasticSearch 7.4.2 Root mapping definition has unsupported parameters
新建索引 PUT people { "settings":{ "number_of_shards":3, "number_of_replicas&qu ...
- Pycharm,出现Invalid VCS root mapping The directory 解决方法
Pycharm File 中setting-------version control 中VCS选择none 后选择ok 执行完以上的步骤,还错误就会消失.
- ElasticSearch基础知识讲解
第一节 ElasticSearch概述 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTfull web接口.ElasticSea ...
- ElasticSearch 7.x 默认不在支持指定索引类型
原文:ElasticSearch 7.x 默认不在支持指定索引类型 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://bl ...
- ElasticSearch 基本概念 and 索引操作 and 文档操作 and 批量操作 and 结构化查询 and 过滤查询
基本概念 索引: 类似于MySQL的表.索引的结构为全文搜索作准备,不存储原始的数据. 索引可以做分布式.每一个索引有一个或者多个分片 shard.每一个分片可以有多个副本 replica. 文档: ...
- ElasticSearch添加索引
1. 编写索引内容 节点解释: settings:配置信息 "number_of_replicas": 0 不需要备份(单节点的ElasticSearch使用) "ma ...
- SpringBoot进阶教程(七十三)整合elasticsearch
Elasticsearch 是一个分布式.高扩展.高实时的搜索与数据分析引擎.它能很方便的使大量数据具有搜索.分析和探索的能力.充分利用Elasticsearch的水平伸缩性,能使数据在生产环境变得更 ...
- elasticsearch 口水篇(6) Mapping 定义索引
前面我们感觉ES就想是一个nosql数据库,支持Free Schema. 接触过Lucene.solr的同学这时可能会思考一个问题——怎么定义document中的field?store.index.a ...
- elasticsearch Mapping 定义索引
Mapping is the process of defining how a document should be mapped to the Search Engine, including i ...
随机推荐
- GET跟POST的区别
GET.POST的区别: 一.GET在浏览器后退时候,可以还原表单大部分数据,POST当浏览器后退时,表单数据将会丢失 二.GET产生的 URL 请求地址可以 Bookmark,而POST不可以 三. ...
- 【docker】删除docker中的运行日志
docker inspect --format='{{.LogPath}}' 容器名称 |sudo xargs -i rm {}
- C语言入门--初来乍到
Hi,我是fish-studio,这是我写的第一篇博客,接下来我会以萌新的角度来与大家一起学习C语言,我也不是什么大佬,在我写的教程中会尽量详细的把我遇到的问题写出来,也会结合一些网上的文章进行编写, ...
- golang 微服务以及相关web框架
golang 中国gocn golang Applicable to all database connection pools xorm是一个简单而强大的Go语言ORM库,通过它可以使数据库操作非常 ...
- 一键获取linux内存、cpu、磁盘IO等信息脚本编写,及其原理详解
更多linux知识,请关注公众号:一口Linux 一.脚本 今天主要分享一个shell脚本,用来获取linux系统CPU.内存.磁盘IO等信息. #!/bin/bash # 获取要监控的本地服务器IP ...
- ASP.NET跨域访问解决
第一种: step1:添加引用(搜索CORS) step2: App_Start/WebApiConfig.cs中添加配置 step3: 在控制器中添加特性 第二种: 在App_Start/WebAp ...
- P1303_A*B Problem(JAVA语言)
思路:BigInteger 三杀! //四行搞定 题目描述 求两数的积. 输入输出格式 输入格式: 两行,两个数. 输出格式: 积 输入输出样例 输入样例#1: 复制 1 2 输出样例#1: 复制 2 ...
- InfluxDB、Grafana等开源软件的监控后门
在使用手机APP的过程中,用户信息会不知不觉的被APP悄无声息的收集到云端,然后进行各种用户行为分析以及智能推荐,这是众所周知但秘而不宣的事. 在使用开源软件时,也存在悄悄收集用户使用信息,并且上报到 ...
- c 结构体内存对齐详解
0x00简介 首先要知道结构体的对齐规制 1.第一个成员在结构体变量偏移量为0的地址处 2.其他成员变量对齐到某个数字的整数倍的地址处 对齐数=编辑器默认的一个对齐数与该成员大小的较小值 vs中默认的 ...
- teprunner测试平台测试计划批量运行用例
本文开发内容 上一篇文章已经把pytest引入到测试平台中,通过多线程和多进程的方式,运行测试用例.有了这个基础,做批量运行用例的功能就很简单了,只需要前端传入一个CaseList即可.本文的后端代码 ...