根据官网序言中提及的,在7.0 取消TransportClient 方式,将采用 rest方式,项目用到的如果版本升级需要采用rest 形式了
We plan on deprecating the TransportClient
in Elasticsearch 7.0 and removing it completely in 8.0. Instead, you should be using the Java High Level REST Client, which executes HTTP requests rather than serialized Java requests. The migration guidedescribes all the steps needed to migrate.
The Java High Level REST Client currently has support for the more commonly used APIs, but there are a lot more that still need to be added. You can help us prioritise by telling us which missing APIs you need for your application by adding a comment to this issue: Java high-level REST client completeness.