diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 7915a8b676..3049c525b6 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -76,9 +76,15 @@ There are multiple low level transports which `OpenSearchClient` could be config ### Create a client using `RestClientTransport` ```java -//Initialize the client with SSL and TLS enabled +import org.apache.http.HttpHost; + +final HttpHost[] hosts = new HttpHost[] { + new HttpHost("localhost", 9200, "http") + }; + +// Initialize the client with SSL and TLS enabled final RestClient restClient = RestClient - .builder(hosts). + .builder(hosts) .build(); OpenSearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); @@ -98,6 +104,12 @@ Upcoming OpenSearch `3.0.0` release brings HTTP/2 support and as such, the `Rest ### Create a client using `ApacheHttpClient5Transport` ```java +import org.apache.hc.core5.http.HttpHost; + +final HttpHost[] hosts = new HttpHost[] { + new HttpHost("localhost", "http", 9200) + }; + final OpenSearchTransport transport = ApacheHttpClient5TransportBuilder .builder(hosts) .setMapper(new JacksonJsonpMapper())