I'm using the java api and I can't figure out how to set the endpoint of my elastic search rest service. My service is at: "https://myhost/els", and I connect like this:
client = TransportClient.builder().settings(settings).build() .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("myhost"), 443)); UpdateRequest updateRequest = new UpdateRequest(); updateRequest.index("myindex"); <-- this is the index name and not the path, right? updateRequest.type("mytype"); client.update(updateRequest).get();
Where do I set the path ('els')?
I have successfully searched the index with the rest client api already:
restClient = RestClient.builder( new HttpHost("myhost", 443,"https")).build(); Response response = restClient.performRequest("POST", "/els/_search", Collections.singletonMap("pretty", "true"), entity);
but the java api doesn't work this way.
Thanks for your help.