File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1+ [[connecting]]
2+ == Connecting
3+
4+ The code snippet below shows how to initialize a low level REST client and the
5+ Jackson object mapper to configure an ElasticsearchClient:
6+
7+ ```
8+ // Create the low-level client
9+ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
10+
11+ // Create the transport that provides JSON and http services to API clients
12+ Transport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
13+
14+ // And create our API client
15+ ElasticsearchClient client = new ElasticsearchClient(transport);
16+ ```
17+
18+ Authentication is managed by the
19+ https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html[low-level Rest Client].
20+ For further details on configuring authentication, refer to the
21+ https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_basic_authentication.html[documentation].
Original file line number Diff line number Diff line change 44include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
55
66include::introduction.asciidoc[]
7- include::installation.asciidoc[]
7+ include::installation.asciidoc[]
8+ include::connecting.asciidoc[]
You can’t perform that action at this time.
0 commit comments