In the documentation here, they initialize an instance of the client with the following code:
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(
new HttpHost("localhost", 9200, "http"),
new HttpHost("localhost", 9201, "http")));
I've configured my ElasticSearch instance on the AWS Console following these instructions. On the summary page for my newly created instance, there is no port number with the domain.
So my question is, given how I've configured my instance how can I set up and make requests using a RestHighLevelClient if I'm not running the instance locally? I've tried
RestHighLevelClient myRestHighLevelClient = new RestHighLevelClient(
RestClient.builder(
new HttpHost(ELASTIC_ENDPOINT_DEV)
)
);
GetRequest getRequest = new GetRequest("myIndex", "myType","myID");
myRestHighLevelClient.get(getRequest);
But I am returned with a java.net.ConnectionException: Connection Refused. Please help!