SpringBoot整合es7.x启动报错:Rejecting mapping update to [AAA] as the final mapping would have more than 1

简介: SpringBoot整合es7.x启动报错:Rejecting mapping update to [AAA] as the final mapping would have more than 1

因为es6.x以后调整一个index只能有一个type,官方默认在所有的index自动加了一个_doc的type,所以当我们不指定或者指定不为_doc的type时,会报这个错误,解决方案:

@Document(indexName = "xxxx",type = "_doc")

如果你的springboot是2.2.x type写为"_doc"。如果是2.3.x  type不写即可。

因为只能有一个type,所以原先的数据库对应index,表对应type这种抽象关系就不成立了,所以indexName直接定义为你们的实体名字就行,为了做区分可以使用xx_xxx的做法,比如说数据库名字是db,实体名是user,那么可以这么定义indexName="db_user"。

相关文章
|
SQL 缓存 Java
SpringBoot系列教程JPA之update使用姿势
上面两篇博文拉开了jpa使用姿势的面纱一角,接下来我们继续往下扯,数据插入db之后,并不是说就一层不变了,就好比我在银行开了户,当然是准备往里面存钱了,有存就有取(特别是当下银行利率这么低还不如买比特币屯着,截止19年6月22日,btc已经突破1.1w$,可惜没钱买😭)这就是我们今天的主题,数据更新--update的使用姿势
1136 0
SpringBoot系列教程JPA之update使用姿势
|
Java
【SpringBoot】WebMvcConfigurer实现类不被加载(o.s.web.servlet.PageNotFound : No mapping for GET)的问题解决
【SpringBoot】WebMvcConfigurer实现类不被加载(o.s.web.servlet.PageNotFound : No mapping for GET)的问题解决
1179 0
|
XML Java 数据库
Spring boot 使用 ON DUPLICATE KEY UPDATE属性控制版本 更新数据不成功
如果更新不成功会报下面的错误(此错误是自定义的): The data you want to update has been updated by another user. Please reopen and try again! 一、主要按下面的流程检查: 1、检查数据库的段alastupdatetime定义 2、检查.xml的alastupdatetime 3、要更新数据的主键是否在同一个updateByBatch中的List中重复出现
684 0
Spring boot 使用 ON DUPLICATE KEY UPDATE属性控制版本 更新数据不成功
|
安全 Java 编译器
Springboot整合Shiro的错误记录:Could not autowire. There is more than one bean of ‘Realm
今天在学习springboot整合shiro,在学习到创建安全管理器的时候出现了如下的错误,刚开始百思不得其解?
471 0
Springboot整合Shiro的错误记录:Could not autowire. There is more than one bean of ‘Realm
|
Java
SpringBoot - Ambiguous mapping Cannot map “XXXController” method
SpringBoot - Ambiguous mapping Cannot map “XXXController” method
160 0
|
Java 关系型数据库 MySQL
Java spring boot 2.0连接mysql异常:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
Java spring boot 2.0连接mysql异常:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone,修改办法
7505 0
|
Java Spring 前端开发
《Springboot极简教程》问题解决:Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping for
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
6865 0
|
Java Spring
《Springboot极简教程》问题解决:javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL [/login] again
javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL [/login] again.
5689 0
|
24天前
|
JavaScript Java 测试技术
基于SpringBoot+Vue实现的留守儿童爱心网站设计与实现(计算机毕设项目实战+源码+文档)
博主是一位全网粉丝超过100万的CSDN特邀作者、博客专家,专注于Java、Python、PHP等技术领域。提供SpringBoot、Vue、HTML、Uniapp、PHP、Python、NodeJS、爬虫、数据可视化等技术服务,涵盖免费选题、功能设计、开题报告、论文辅导、答辩PPT等。系统采用SpringBoot后端框架和Vue前端框架,确保高效开发与良好用户体验。所有代码由博主亲自开发,并提供全程录音录屏讲解服务,保障学习效果。欢迎点赞、收藏、关注、评论,获取更多精品案例源码。
59 10
|
24天前
|
JavaScript Java 测试技术
基于SpringBoot+Vue实现的家政服务管理平台设计与实现(计算机毕设项目实战+源码+文档)
面向大学生毕业选题、开题、任务书、程序设计开发、论文辅导提供一站式服务。主要服务:程序设计开发、代码修改、成品部署、支持定制、论文辅导,助力毕设!
43 8