failed to load elasticsearch nodes 。。。。。No type specified for field [name]
翻译: 加载ElasticSearch节点失败。。。。。没有为字段[名称]指定类型

所使用elasticsearch版本为5.6.15

原因一:

如果是使用java类来映射elasticsearch中index下的type

那么当使用@Field注解时,请指定属性的类型

// 引入的包
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType; // 像这样
@Field(type = FieldType.Long)
private Long id; // 不可这样, 启动项目时由于不知道属性的类型,所以无法创建index下的type
@Field
private Long id;

但是在做新增操作时,elasticsearch会自动创建类型, 而这个类型下的属性下的参数是有问题的(也可能是我看不懂)

如下图部门名称是自动生成的

其实我们只需要指定部门的类型即可,像这样

@Field(type = FieldType.Text)
private String departmentName;

我们不需要fields这个属性

注意每当我们改变elasticsearch中的index下的type下的属性名的类型或参数时,就我所知只能删除index重新生成(我不知道如何删除index下的type)

否则便会报如下错

You can't change existing mapping type, you need to create a new index with the correct mapping and index the data again

翻译: 不能更改现有的映射类型,需要使用正确的映射创建新的索引,然后重新索引数据。

需要怎么做呢?

删除有问题的索引,为每个属性指定相应的类型。重新索引数据。

使用elasticsearch启动项目报错failed to load elasticsearch nodes 。。。。。No type specified for field [name]的更多相关文章

  1. Eclipse启动 报错[Failed to load the JNI shared library jvm.dll

    准备要做java服务器,在安装开发环境时,启动Eclipse报错[Failed to load the JNI shared library jvm.dll] 研究了下,造成错误的原因是由于eclip ...

  2. tomcat7 启动项目报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()

    JDK版本:jdk1.8.0_77 Tomcat 版本:apache-tomcat-7.0.47 异常重现步骤: 1.完成项目部署 2.启动Tomcat 异常头部信息:java.lang.NoSuch ...

  3. eclipse启动项目报错:java.lang.ClassNotFoundException: ContextLoaderListener

    eclipse 启动项目报错:找不到 Spring 监听器类 org.springframework.web.context.ContextLoaderListener 严重: Error confi ...

  4. 解决:启动项目报错 java.lang.UnsatisfiedLinkError: D:\Java\apache-tomcat-8.0.17\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

    启动项目报错如下: java.lang.UnsatisfiedLinkError: D:\Java\apache-tomcat-8.0.17\bin\tcnative-1.dll: Can't loa ...

  5. 启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException

    dubbo项目: 启动项目报错:(web端) org.springframework.beans.factory.UnsatisfiedDependencyException: Error creat ...

  6. junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题

    junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题,说明代码是没问题的,配置也没问题.开始时怀疑是我使用junit版本 ...

  7. IDEA启动项目报错:Cannot open URL.Please check this URL is correct

    IDEA启动项目报错:Cannot open URL.Please check this URL is correct 问题:IDEA启动SSM项目,使用的Tomcat,报错 Cannot open ...

  8. Springboot项目 配置数据库连接属性后,启动项目报错

    Springboot项目 配置数据库连接属性后,启动项目报错,错误如下: 错误原因分析: 1.连接信息配置错误 当使用properties为配置文件时,如图所示,上面的 spring.datasour ...

  9. 使用laravel-admin后台sdk报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID、Provisional headers are shown

    报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID请先确定自己的资源url是否可以确实访问到(地址正确与否.访问权限是否开启等) 若n ...

随机推荐

  1. POJ 2954-Triangle(计算几何+皮克定理)

    职务地址:POJ 2954 意甲冠军:三个顶点的三角形,给出,内部需求格点数. 思考:就像POJ 1265. #include <stdio.h> #include <math.h& ...

  2. boost::bind应用示例

    // testBind.cpp : Defines the entry point for the console application. // #include "stdafx.h&qu ...

  3. ShopNC本地生活o2o网站的源代码,没有域名限制

    较前某VIP源代码论坛分享了套ShopNC本地生活o2o站点系统.下载过来却发现根本不能用,所以一直没分享出来.今天咱们这边分享的这套ShopNC本地生活o2o站点源代码,无不论什么的限制,直接ins ...

  4. 【LeetCode】LRU Cache 解决报告

    插话:只写了几个连续的博客,博客排名不再是实际"远在千里之外"该.我们已经进入2一万内. 再接再厉.油! Design and implement a data structure ...

  5. [转帖 ]MySQL 5.7 新特性 JSON

    MySQL 5.7 新特性 JSON 的创建,插入,查询,更新 作者: 我不是鱼 (2016-08-31 16:13)分类: MySQL   标签: MySQL JSON MySQL JSON 应用 ...

  6. WPF特效-绘图

    原文:WPF特效-绘图                  WPF玩起来还是挺炫酷的.我实现的效果:不同色块交叉,交叉部分颜色叠加显示.(叠加部分暂时用随机颜色代替).单独色块点击弹出以色块颜色为主的附 ...

  7. 备份一个个人用的WPF万能转换器

    public class CommonCoverter : IValueConverter { /// 转换器参数语法: key1,value1 key2,value2 ... [other,defu ...

  8. String内存结构

    var s: AnsiString; begin s := '1234567890'; showmessage(s); end; 变量s的内存结构为A8 03 01 00 FF FF FF FF 0A ...

  9. GIS基础软件及操作(七)

    原文 GIS基础软件及操作(七) 练习七.地形分析 地形分析:TIN及DEM的生成及应用 加深对TIN建立过程的原理.方法的认识: 熟练掌握ArcGIS中建立DEM.TIN的技术方法: 结合实际,掌握 ...

  10. C#有哪几种定时器

    1.定义在System.Windows.Forms里2.定义在System.Threading.Timer类里3.定义在System.Timers.Timer类里 System.Windows.For ...