From f82028b2d05dd117a888d0ca035da38209052f7f Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Tue, 23 May 2023 14:39:54 -0400 Subject: [PATCH] Address code review comments Signed-off-by: Andriy Redko --- USER_GUIDE.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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())