具體報錯:
java.io.IOException: Unable to parse response body for Response{requestLine=PUT /books/_doc/1?timeout=1m HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 201 Created}
原因:
根據(jù)官方提供的文檔,選擇SpringBoot支持的Elasticsearch對應(yīng)版本
Elasticsearch的迭代太快了,springboot不一定支持,導致我使用Elasticsearch 8.0的時候報錯,根據(jù)你的springboot版本更換掉對應(yīng)的Elasticsearch 版本即可
下面是官方提供的Elasticsearch對應(yīng)springboot版本,具體地址:https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/文章來源:http://www.zghlxwxcb.cn/news/detail-516159.html
建議:
Elasticsearch千萬不要下載太高的版本,不就Spring不支持,Ik分詞也不支持文章來源地址http://www.zghlxwxcb.cn/news/detail-516159.html
到了這里,關(guān)于SpringBoot整合Elasticsearch報錯:Unable to parse response body for Response的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!