Skip to content

Commit 6c9774c

Browse files
authored
Merge pull request #13 from szabosteve/initial.docs
[DOCS] Adds Introduction, Installation, and Connecting sections to Java client docs
2 parents e8e760b + 6569dc6 commit 6c9774c

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed

docs/connecting.asciidoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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].

docs/index.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
= Elasticsearch Java High-level client
2+
3+
:branch: master
4+
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
5+
6+
include::introduction.asciidoc[]
7+
include::installation.asciidoc[]
8+
include::connecting.asciidoc[]

docs/installation.asciidoc

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[[installation]]
2+
== Installation
3+
4+
This page guides you through the installation process of the client.
5+
6+
Requirements:
7+
8+
* Java 8 or later. The library provides high-level type-safe classes
9+
and methods for all {es} APIs. It sits on top of the
10+
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.htm8l[Low Level Rest Client]
11+
that manages all http communications.
12+
13+
* The JSON implementation used by the Java client is pluggable and you must add
14+
a JSON object mapping library as a dependency to your project. It has support
15+
for https://github.com/FasterXML/jackson[Jackson] or a
16+
http://json-b.net/[JSON-B] library like
17+
https://github.com/eclipse-ee4j/yasson[Eclipse Yasson].
18+
19+
20+
The GA releases are hosted on Maven Central. Snapshot versions are hosted on
21+
https://snapshots.elastic.co/maven/[Elastic's Maven snapshot repository].
22+
23+
24+
[discrete]
25+
[[gradle]]
26+
=== Installation in a Gradle project by using Jackson
27+
28+
```
29+
repositories {
30+
mavenCentral()
31+
maven {
32+
name = "Elastic-Snapshots"
33+
url = uri("https://snapshots.elastic.co/maven")
34+
}
35+
}
36+
37+
dependencies {
38+
implementation 'co.elastic.clients:elasticsearch-java:7.15.0-SNAPSHOT'
39+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
40+
}
41+
```
42+
43+
[discrete]
44+
[[maven]]
45+
=== Installation in a Maven project by using Jackson
46+
47+
In the `pom.xml` of your project, add the following repository definition and
48+
dependencies:
49+
50+
```
51+
<project>
52+
53+
<repositories>
54+
<repository>
55+
<id>Elastic-Snapshots</id>
56+
<url>https://snapshots.elastic.co/maven</url>
57+
<snapshots>
58+
<enabled>true</enabled>
59+
</snapshots>
60+
</repository>
61+
</repositories>
62+
63+
<dependencies>
64+
<dependency>
65+
<groupId>co.elastic.clients</groupId>
66+
<artifactId>elasticsearch-java</artifactId>
67+
<version>7.15.0-SNAPSHOT</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>com.fasterxml.jackson.core</groupId>
71+
<artifactId>jackson-databind</artifactId>
72+
<version>2.12.3</version>
73+
</dependency>
74+
</dependencies>
75+
76+
</project>
77+
```
78+
79+
[discrete]
80+
[[compatibility]]
81+
=== Compatibility
82+
83+
The `main` branch targets the next major release (8.0), the `7.x` branch targets
84+
the next minor release. Support is still incomplete as the API code is generated
85+
from the {es} Specification that is also still a work in progress.
86+
87+
The {es} Java client is forward compatible; meaning that the client supports
88+
communicating with greater or equal minor versions of {es}. {es} language
89+
clients are only backwards compatible with default distributions and without
90+
guarantees made.

docs/introduction.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[[introduction]]
2+
== Introduction
3+
4+
experimental[]
5+
6+
This is the official Java high-level REST client for {es}. It works on the top
7+
of the Java low-level REST client. The client provides strongly typed requests
8+
and responses for all {es} APIs. It delegates protocol handling to an http
9+
client such as the
10+
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-low.html[{es} Low Level REST client]
11+
that takes care of all transport-level concerns. This page gives a quick
12+
overview about the features of the client.

0 commit comments

Comments
 (0)