Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/java-rest/high-level/apis.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== Supported APIs
== Supported APIs

The Java High Level REST Client supports the following APIs:

Expand Down
14 changes: 7 additions & 7 deletions docs/java-rest/high-level/apis/_index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[[java-rest-high-document-index]]
==== Index API
=== Index API

[[java-rest-high-document-index-request]]
===== Index Request
==== Index Request

An `IndexRequest` requires the following arguments:

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

===== Providing the document source
==== Providing the document source
The document source can be provided in different ways:

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

===== Optional arguments
==== Optional arguments
The following arguments can optionally be provided:

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

[[java-rest-high-document-index-sync]]
===== Synchronous Execution
==== Synchronous Execution

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

[[java-rest-high-document-index-async]]
===== Asynchronous Execution
==== Asynchronous Execution

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

[[java-rest-high-document-index-response]]
===== Index Response
==== Index Response

The returned `IndexResponse` allows to retrieve information about the executed
operation as follows:
Expand Down
12 changes: 6 additions & 6 deletions docs/java-rest/high-level/apis/delete.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[[java-rest-high-document-delete]]
==== Delete API
=== Delete API

[[java-rest-high-document-delete-request]]
===== Delete Request
==== Delete Request

A `DeleteRequest` requires the following arguments:

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

===== Optional arguments
==== Optional arguments
The following arguments can optionally be provided:

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

[[java-rest-high-document-delete-sync]]
===== Synchronous Execution
==== Synchronous Execution

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

[[java-rest-high-document-delete-async]]
===== Asynchronous Execution
==== Asynchronous Execution

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

[[java-rest-high-document-delete-response]]
===== Delete Response
==== Delete Response

The returned `DeleteResponse` allows to retrieve information about the executed
operation as follows:
Expand Down
8 changes: 7 additions & 1 deletion docs/java-rest/high-level/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[java-rest-high]]
== Java High Level REST Client
= Java High Level REST Client

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

--

include::usage.asciidoc[]

include::apis.asciidoc[]

include::apis/index.asciidoc[]

include::../license.asciidoc[]
15 changes: 9 additions & 6 deletions docs/java-rest/high-level/usage.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[[java-rest-high-usage]]
=== Getting started
== Getting started

This section describes how to get started with the high-level REST client from
getting the artifact to using it in an application.

[[java-rest-high-usage-maven]]
==== Maven Repository
=== Maven Repository

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

[[java-rest-high-usage-maven-maven]]
===== Maven configuration
==== Maven configuration

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

[[java-rest-high-usage-maven-gradle]]
===== Gradle configuration
==== Gradle configuration

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

[[java-rest-high-usage-dependencies]]
==== Dependencies
=== Dependencies

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


[[java-rest-high-usage-initialization]]
==== Initialization
=== Initialization

A `RestHighLevelClient` instance needs a <<java-rest-low-usage-initialization,REST low-level client>>
to be built as follows:
Expand Down
2 changes: 0 additions & 2 deletions docs/java-rest/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ include::overview.asciidoc[]
include::low-level/index.asciidoc[]

include::high-level/index.asciidoc[]

include::license.asciidoc[]
1 change: 0 additions & 1 deletion docs/java-rest/license.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[[java-rest-license]]
== License

Copyright 2013-2017 Elasticsearch
Expand Down
12 changes: 6 additions & 6 deletions docs/java-rest/low-level/configuration.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== Common configuration
== Common configuration

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

==== Timeouts
=== Timeouts

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

==== Number of threads
=== Number of threads

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

==== Basic authentication
=== Basic authentication

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

==== Encrypted communication
=== Encrypted communication

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

==== Others
=== Others

For any other required configuration needed, the Apache HttpAsyncClient docs
should be consulted: https://hc.apache.org/httpcomponents-asyncclient-4.1.x/ .
8 changes: 7 additions & 1 deletion docs/java-rest/low-level/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[[java-rest-low]]
== Java Low Level REST Client
= Java Low Level REST Client

[partintro]
--

The low-level client's features include:

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

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

--

include::usage.asciidoc[]

include::configuration.asciidoc[]

include::sniffer.asciidoc[]

include::../license.asciidoc[]
27 changes: 5 additions & 22 deletions docs/java-rest/low-level/sniffer.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[sniffer]]
=== Sniffer
== Sniffer

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

Compatible with Elasticsearch 2.x and onwards.

==== Maven Repository
=== Maven Repository

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


===== Maven configuration
==== Maven configuration

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

===== Gradle configuration
==== Gradle configuration

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

==== Usage
=== Usage

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

Note that this last configuration parameter has no effect in case sniffing
on failure is not enabled like explained above.

==== License

Copyright 2013-2017 Elasticsearch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Loading