java向es中寫入數(shù)據(jù)報錯org.elasticsearch.action.ActionReque問題
java操作es寫入數(shù)據(jù)報錯
如下:
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]
后分析查看報錯信息發(fā)現(xiàn),打印日志中使用的es版本為6.8.6(2.2.5.RELEASE版本默認使用的es版本),而我們使用的7.6.1中的一些調用方式,所以導致報錯。
解決
修改es版本為7.6.1

再次啟動,測試,ok問題解決。
總結
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
Spring Boot集成Sorl搜索客戶端的實現(xiàn)代碼
本篇文章主要介紹了Spring Boot集成Sorl搜索客戶端的實現(xiàn)代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-11-11
Java數(shù)據(jù)結構實現(xiàn)二維數(shù)組與稀疏數(shù)組轉換詳解
稀疏數(shù)組是用于優(yōu)化,壓縮具有以下特點的二維數(shù)組:當二維數(shù)組中的元素大部分相同,有意義的數(shù)據(jù)元素較少時,可以使用稀疏數(shù)組進行簡化,節(jié)省存儲空間2021-10-10
SpringBoot使用TraceId進行日志追蹤的實現(xiàn)
本文主要介紹了SpringBoot使用TraceId進行日志追蹤的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2025-01-01

