Spring Data Elasticsearch's ElasticsearchTemplate vs ElasticsearchRepository
问题 I am in reference to Spring Data Elasticsearch's org.springframework.data.elasticsearch.repository.ElasticsearchRepository org.springframework.data.elasticsearch.core.ElasticsearchTemplate It seems they are two different APIs that achieve the same goal but I am not sure what the differences are between those two types and more importantly when to use which. Can someone please provide advice and guidance? 回答1: ElasticsearchRepository is intended to be used as a repository for your domain