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中的一些調(diào)用方式,所以導致報錯。
解決
修改es版本為7.6.1

再次啟動,測試,ok問題解決。
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Spring操作JdbcTemplate數(shù)據(jù)庫的方法學習
這篇文章主要為大家介紹了Spring操作JdbcTemplate數(shù)據(jù)庫方法學習,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-05-05
java算法題解LeetCode30包含min函數(shù)的棧實例
這篇文章主要為大家介紹了java算法題解LeetCode30包含min函數(shù)的棧實例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-01-01
關(guān)于ApplicationContext的三個常用實現(xiàn)類
這篇文章主要介紹了關(guān)于ApplicationContext的三個常用實現(xiàn)類,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-06-06

