An overview,

Elasticsearch extends ElasticsearchRepository (springBoot) ElasticsearchRepository (springBoot) ElasticsearchRepository (SpringBoot) However, the methods in the new version of ElasticsearchRepository are largely outdated.

Let’s go to the official website of Spring,

As you can see, the official Github example changes to extends CrudRepository

p.s.

This article was written for the following reasons

  • The current ElasticSearch tutorials are old

  • The ElasticsearchRepository method is basically obsolete in the new version

  • The CrudRepository operation based on SpringData is relatively complete in ES package, but there are few online tutorials

Second, the list

Java Elasticsearch 7.10 tutorial

zhuanlan.zhihu.com/p/321248369

Sample source code:

Gitee.com/hankzhousan…

Edited just now