具体报错:

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}

原因:

根据官方提供的文档,选择SpringBoot支持的Elasticsearch对应版本

Elasticsearch的迭代太快了,springboot不一定支持,导致我使用Elasticsearch 8.0的时候报错,根据你的springboot版本更换掉对应的Elasticsearch 版本即可

下面是官方提供的Elasticsearch对应springboot版本,具体地址:https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/

在这里插入图片描述
建议:
Elasticsearch千万不要下载太高的版本,不就Spring不支持,Ik分词也不支持

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐