Skip to content

Commit 3c5eb6c

Browse files
authored
[DOCS] restructure java clients docs pages (#25517)
This commit converts the low level client and high level client chapters into two parts, which allows each high level client supported api to be on a separate page and show up in the index on the right.
1 parent 8296618 commit 3c5eb6c

File tree

12 files changed

+70
-70
lines changed

12 files changed

+70
-70
lines changed

docs/java-rest/high-level/apis.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Supported APIs
1+
== Supported APIs
22

33
The Java High Level REST Client supports the following APIs:
44

docs/java-rest/high-level/apis/_index.asciidoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[java-rest-high-document-index]]
2-
==== Index API
2+
=== Index API
33

44
[[java-rest-high-document-index-request]]
5-
===== Index Request
5+
==== Index Request
66

77
An `IndexRequest` requires the following arguments:
88

@@ -15,7 +15,7 @@ include-tagged::{doc-tests}/CRUDDocumentationIT.java[index-request-string]
1515
<3> Document id
1616
<4> Document source provided as a `String`
1717

18-
===== Providing the document source
18+
==== Providing the document source
1919
The document source can be provided in different ways:
2020

2121
["source","java",subs="attributes,callouts,macros"]
@@ -39,7 +39,7 @@ include-tagged::{doc-tests}/CRUDDocumentationIT.java[index-request-shortcut]
3939
<1> Document source provided as `Object` key-pairs, which gets converted to
4040
JSON format
4141

42-
===== Optional arguments
42+
==== Optional arguments
4343
The following arguments can optionally be provided:
4444

4545
["source","java",subs="attributes,callouts,macros"]
@@ -94,15 +94,15 @@ include-tagged::{doc-tests}/CRUDDocumentationIT.java[index-request-pipeline]
9494
<1> The name of the ingest pipeline to be executed before indexing the document
9595

9696
[[java-rest-high-document-index-sync]]
97-
===== Synchronous Execution
97+
==== Synchronous Execution
9898

9999
["source","java",subs="attributes,callouts,macros"]
100100
--------------------------------------------------
101101
include-tagged::{doc-tests}/CRUDDocumentationIT.java[index-execute]
102102
--------------------------------------------------
103103

104104
[[java-rest-high-document-index-async]]
105-
===== Asynchronous Execution
105+
==== Asynchronous Execution
106106

107107
["source","java",subs="attributes,callouts,macros"]
108108
--------------------------------------------------
@@ -113,7 +113,7 @@ provided as an argument.
113113
<2> Called in case of failure. The raised exception is provided as an argument.
114114

115115
[[java-rest-high-document-index-response]]
116-
===== Index Response
116+
==== Index Response
117117

118118
The returned `IndexResponse` allows to retrieve information about the executed
119119
operation as follows:

docs/java-rest/high-level/apis/delete.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[java-rest-high-document-delete]]
2-
==== Delete API
2+
=== Delete API
33

44
[[java-rest-high-document-delete-request]]
5-
===== Delete Request
5+
==== Delete Request
66

77
A `DeleteRequest` requires the following arguments:
88

@@ -14,7 +14,7 @@ include-tagged::{doc-tests}/CRUDDocumentationIT.java[delete-request]
1414
<2> Type
1515
<3> Document id
1616

17-
===== Optional arguments
17+
==== Optional arguments
1818
The following arguments can optionally be provided:
1919

2020
["source","java",subs="attributes,callouts,macros"]
@@ -56,15 +56,15 @@ include-tagged::{doc-tests}/CRUDDocumentationIT.java[delete-request-version-type
5656
<1> Version type
5757

5858
[[java-rest-high-document-delete-sync]]
59-
===== Synchronous Execution
59+
==== Synchronous Execution
6060

6161
["source","java",subs="attributes,callouts,macros"]
6262
--------------------------------------------------
6363
include-tagged::{doc-tests}/CRUDDocumentationIT.java[delete-execute]
6464
--------------------------------------------------
6565

6666
[[java-rest-high-document-delete-async]]
67-
===== Asynchronous Execution
67+
==== Asynchronous Execution
6868

6969
["source","java",subs="attributes,callouts,macros"]
7070
--------------------------------------------------
@@ -75,7 +75,7 @@ provided as an argument.
7575
<2> Called in case of failure. The raised exception is provided as an argument.
7676

7777
[[java-rest-high-document-delete-response]]
78-
===== Delete Response
78+
==== Delete Response
7979

8080
The returned `DeleteResponse` allows to retrieve information about the executed
8181
operation as follows:

docs/java-rest/high-level/index.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[[java-rest-high]]
2-
== Java High Level REST Client
2+
= Java High Level REST Client
33

4+
[partintro]
5+
--
46
The Java High Level REST Client works on top of the Java Low Level REST client.
57
Its main goal is to expose API specific methods, that accept request objects as
68
an argument and return response objects, so that request marshalling and
@@ -16,8 +18,12 @@ The Java High Level REST Client depends on the Elasticsearch core project.
1618
It accepts the same request arguments as the `TransportClient` and returns
1719
the same response objects.
1820

21+
--
22+
1923
include::usage.asciidoc[]
2024

2125
include::apis.asciidoc[]
2226

2327
include::apis/index.asciidoc[]
28+
29+
include::../license.asciidoc[]

docs/java-rest/high-level/usage.asciidoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[[java-rest-high-usage]]
2-
=== Getting started
2+
== Getting started
3+
4+
This section describes how to get started with the high-level REST client from
5+
getting the artifact to using it in an application.
36

47
[[java-rest-high-usage-maven]]
5-
==== Maven Repository
8+
=== Maven Repository
69

710
The high-level Java REST client is hosted on
811
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.elasticsearch.client%22[Maven
@@ -12,7 +15,7 @@ The High Level REST Client is subject to the same release cycle as
1215
Elasticsearch. Replace the version with the desired client version.
1316

1417
[[java-rest-high-usage-maven-maven]]
15-
===== Maven configuration
18+
==== Maven configuration
1619

1720
Here is how you can configure the dependency using maven as a dependency manager.
1821
Add the following to your `pom.xml` file:
@@ -27,7 +30,7 @@ Add the following to your `pom.xml` file:
2730
--------------------------------------------------
2831

2932
[[java-rest-high-usage-maven-gradle]]
30-
===== Gradle configuration
33+
==== Gradle configuration
3134

3235
Here is how you can configure the dependency using gradle as a dependency manager.
3336
Add the following to your `build.gradle` file:
@@ -40,7 +43,7 @@ dependencies {
4043
--------------------------------------------------
4144

4245
[[java-rest-high-usage-dependencies]]
43-
==== Dependencies
46+
=== Dependencies
4447

4548
The High Level Java REST Client depends on the following artifacts and their
4649
transitive dependencies:
@@ -50,7 +53,7 @@ transitive dependencies:
5053

5154

5255
[[java-rest-high-usage-initialization]]
53-
==== Initialization
56+
=== Initialization
5457

5558
A `RestHighLevelClient` instance needs a <<java-rest-low-usage-initialization,REST low-level client>>
5659
to be built as follows:

docs/java-rest/index.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ include::overview.asciidoc[]
88
include::low-level/index.asciidoc[]
99

1010
include::high-level/index.asciidoc[]
11-
12-
include::license.asciidoc[]

docs/java-rest/license.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[[java-rest-license]]
21
== License
32

43
Copyright 2013-2017 Elasticsearch

docs/java-rest/low-level/configuration.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Common configuration
1+
== Common configuration
22

33
The `RestClientBuilder` supports providing both a `RequestConfigCallback` and
44
an `HttpClientConfigCallback` which allow for any customization that the Apache
@@ -8,7 +8,7 @@ configuration that the `RestClient` is initialized with. This section
88
describes some common scenarios that require additional configuration for the
99
low-level Java REST Client.
1010

11-
==== Timeouts
11+
=== Timeouts
1212

1313
Configuring requests timeouts can be done by providing an instance of
1414
`RequestConfigCallback` while building the `RestClient` through its builder.
@@ -34,7 +34,7 @@ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200))
3434
.build();
3535
--------------------------------------------------
3636

37-
==== Number of threads
37+
=== Number of threads
3838

3939
The Apache Http Async Client starts by default one dispatcher thread, and a
4040
number of worker threads used by the connection manager, as many as the number
@@ -55,7 +55,7 @@ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200))
5555
.build();
5656
--------------------------------------------------
5757

58-
==== Basic authentication
58+
=== Basic authentication
5959

6060
Configuring basic authentication can be done by providing an
6161
`HttpClientConfigCallback` while building the `RestClient` through its builder.
@@ -104,7 +104,7 @@ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200))
104104
.build();
105105
--------------------------------------------------
106106

107-
==== Encrypted communication
107+
=== Encrypted communication
108108

109109
Encrypted communication can also be configured through the
110110
`HttpClientConfigCallback`. The
@@ -130,7 +130,7 @@ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200))
130130
.build();
131131
--------------------------------------------------
132132

133-
==== Others
133+
=== Others
134134

135135
For any other required configuration needed, the Apache HttpAsyncClient docs
136136
should be consulted: https://hc.apache.org/httpcomponents-asyncclient-4.1.x/ .

docs/java-rest/low-level/index.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[[java-rest-low]]
2-
== Java Low Level REST Client
2+
= Java Low Level REST Client
3+
4+
[partintro]
5+
--
36

47
The low-level client's features include:
58

@@ -19,9 +22,12 @@ The low-level client's features include:
1922

2023
* optional automatic <<sniffer,discovery of cluster nodes>>
2124

25+
--
2226

2327
include::usage.asciidoc[]
2428

2529
include::configuration.asciidoc[]
2630

2731
include::sniffer.asciidoc[]
32+
33+
include::../license.asciidoc[]

docs/java-rest/low-level/sniffer.asciidoc

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[sniffer]]
2-
=== Sniffer
2+
== Sniffer
33

44
Minimal library that allows to automatically discover nodes from a running
55
Elasticsearch cluster and set them to an existing `RestClient` instance.
@@ -8,7 +8,7 @@ Nodes Info api and uses jackson to parse the obtained json response.
88

99
Compatible with Elasticsearch 2.x and onwards.
1010

11-
==== Maven Repository
11+
=== Maven Repository
1212

1313
The low-level REST client is subject to the same release cycle as
1414
elasticsearch. Replace the version with the desired sniffer version, first
@@ -17,7 +17,7 @@ and the elasticsearch version that the client can communicate with. Sniffer
1717
supports fetching the nodes list from elasticsearch 2.x and onwards.
1818

1919

20-
===== Maven configuration
20+
==== Maven configuration
2121

2222
Here is how you can configure the dependency using maven as a dependency manager.
2323
Add the following to your `pom.xml` file:
@@ -31,7 +31,7 @@ Add the following to your `pom.xml` file:
3131
</dependency>
3232
--------------------------------------------------
3333

34-
===== Gradle configuration
34+
==== Gradle configuration
3535

3636
Here is how you can configure the dependency using gradle as a dependency manager.
3737
Add the following to your `build.gradle` file:
@@ -43,7 +43,7 @@ dependencies {
4343
}
4444
--------------------------------------------------
4545

46-
==== Usage
46+
=== Usage
4747

4848
Once a `RestClient` instance has been created, a `Sniffer` can be associated
4949
to it. The `Sniffer` will make use of the provided `RestClient` to periodically
@@ -132,20 +132,3 @@ Sniffer sniffer = Sniffer.builder(restClient)
132132

133133
Note that this last configuration parameter has no effect in case sniffing
134134
on failure is not enabled like explained above.
135-
136-
==== License
137-
138-
Copyright 2013-2017 Elasticsearch
139-
140-
Licensed under the Apache License, Version 2.0 (the "License");
141-
you may not use this file except in compliance with the License.
142-
You may obtain a copy of the License at
143-
144-
http://www.apache.org/licenses/LICENSE-2.0
145-
146-
Unless required by applicable law or agreed to in writing, software
147-
distributed under the License is distributed on an "AS IS" BASIS,
148-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149-
See the License for the specific language governing permissions and
150-
limitations under the License.
151-

0 commit comments

Comments
 (0)