RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
ElasticsearchClient client = new ElasticsearchClient(transport);
So, I guess we need to use "Elasticsearch" and cannot use the "Elastic Cloud" since we would be using Java and it is not ready yet. Under "Elasticsearch > Deploy on Elastic Cloud" is misleading!
Elasticsearch is part of the Elastic Stack. The stack is deployable on cloud.elastic.co. There you will have Elasticsearch and Kibana (and other services if needed).
For this one, there is no official Java client AFAIK but you can build your own, just like I shared.
Then it can connect to both cloud.elastic.co or to the on premise service.
I ran another deployment on Elastic Cloud. I removed "Enterprise Search" and opted for Elasticsearch and Kibana. I do not see the "Elasticsearch" option.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.