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 ...
随机推荐
- freebsd root 登录 KDE SDDM
sddm.conf 文件现在默认不会自动生成了.需要自己创建:ee /usr/local/etc/sddm.conf写入MinimumUid=0MaximumUid=00就是root用户.然后更改/u ...
- 选择 FreeBSD 而不是 Linux 的技术性原因2
ZFSZFS 文件系统是 FreeBSD 上的一等公民.这不仅意味着可以在 ZFS 上安装根目录,安装程序也支持这一点,而且还意味着很多基础系统工具都已经紧密地集成或构建了对 ZFS 的支持.在 Fr ...
- Everything is Serverless,从开源框架对比说起
摘要:Everything is Serverless. 在众多云计算解决方案中,Serverless 逐渐崭露头角,受到了很多关注并且发展迅猛,今天就关于serverless 开源框架细说二三. 什 ...
- WPF 基础 - 在模板中找元素
1. 在 ControlTemplate 中寻找元素 <Window.Resources> <ControlTemplate x:Key="cTmp"> & ...
- IPFS是什么?IPFS与Filecoin有什么关系?
Filecoin 基于 IPFS 的去中心化存储网络,是 IPFS 上唯一的激励层,是一个基于区块链技术发行的通证.Filecoin 翻译过来就是文件币,简称为 FIL. 在 FIlecoin 网络中 ...
- 半监督学习方法(Semi-supervised Learning)的分类
根据模型的训练策略划分: 直推式学习(Transductive Semi-supervised Learning) 无标记数据就是最终要用来测试的数据,学习的目的就是在这些数据上取得最佳泛化能力. 归 ...
- ASPOSE.Cells & ASPOSE.Words 操纵Excel和Word文档的 .NET Core 实例
Aspose.Total是Aspose公司旗下的最全的一套office文档管理方案,它提供的原生API可以对Word.Excel.PDF.Powerpoint.Outlook.CAD.图片.3D.ZI ...
- CQGUI框架之阴影圆角窗口实现
CQGUI框架之阴影圆角窗口实现 大家好,我是IT文艺男,来自一线大厂的一线程序员 今天给大家讲解基于C++/Qt的CQGUI框架的阴影圆角窗口实现,实现效果如下图所示:: CQGUI开发环境:: M ...
- pgrep - 命令
pgrep 命令格式:pgrep [选项] [模式] 选项 含义 -d <string> 指定输出分隔符 -l PID和进程名称 -a 列出PID和完整的命令行 -v 取反 -c 统计进程 ...
- 极简实用的Asp.NetCore模块化框架新增CMS模块
简介 关于这个框架的背景,在前面我已经交代过了.不清楚的可以查看这个链接 极简实用的Asp.NetCore模块化框架决定免费开源了 在最近一段时间内,对这个框架新增了以下功能: 1.新增了CMS模块, ...