java向es中写入数据报错org.elasticsearch.action.ActionRequestValidationException

java操作es写入数据报错如下:

org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;6: type is missing;7: type is missing;8: type is missing;9: type is missing;10: type is missing;11: type is missing;12: type is missing;13: type is missing;14: type is missing;15: type is missing;16: type is missing;17: type is missing;18: type is missing;19: type is missing;20: type is missing;21: type is missing;22: type is missing;23: type is missing;24: type is missing;25: type is missing;26: type is missing;27: type is missing;28: type is missing;29: type is missing;30: type is missing;
at org.elasticsearch.action.bulk.BulkRequest.validate(BulkRequest.java:614) ~[elasticsearch-6.8.6.jar:6.8.6]
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1730) ~[elasticsearch-rest-high-level-client-6.8.6.jar:6.8.6]

后分析查看报错信息发现,打印日志中使用的es版本为6.8.6(2.2.5.RELEASE版本默认使用的es版本),而我们使用的7.6.1中的一些调用方式,所以导致报错。

解决:修改es版本为7.6.1

再次启动,测试,ok问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值