Added Put Mapping API to high-level Rest client (#27869)

Relates to #27205
This commit is contained in:
Catalin Ursachi 2018-01-23 10:03:32 +00:00 committed by Luca Cavanna
parent 4ef341a0c3
commit cf61d792b2
13 changed files with 481 additions and 11 deletions

View file

@ -6,6 +6,8 @@ include::open_index.asciidoc[]
include::close_index.asciidoc[]
include::putmapping.asciidoc[]
include::_index.asciidoc[]
include::get.asciidoc[]

View file

@ -0,0 +1,71 @@
[[java-rest-high-put-mapping]]
=== Put Mapping API
[[java-rest-high-put-mapping-request]]
==== Put Mapping Request
A `PutMappingRequest` requires an `index` argument, and a type:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-request]
--------------------------------------------------
<1> The index to add the mapping to
<2> The type to create (or update)
==== Mapping source
A description of the fields to create on the mapping; if not defined, the mapping will default to empty.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-request-source]
--------------------------------------------------
<1> The mapping source
==== Optional arguments
The following arguments can optionally be provided:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-request-timeout]
--------------------------------------------------
<1> Timeout to wait for the all the nodes to acknowledge the index creation as a `TimeValue`
<2> Timeout to wait for the all the nodes to acknowledge the index creation as a `String`
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-request-masterTimeout]
--------------------------------------------------
<1> Timeout to connect to the master node as a `TimeValue`
<2> Timeout to connect to the master node as a `String`
[[java-rest-high-put-mapping-sync]]
==== Synchronous Execution
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-execute]
--------------------------------------------------
[[java-rest-high-put-mapping-async]]
==== Asynchronous Execution
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-execute-async]
--------------------------------------------------
<1> Called when the execution is successfully completed. The response is
provided as an argument
<2> Called in case of failure. The raised exception is provided as an argument
[[java-rest-high-put-mapping-response]]
==== Put Mapping Response
The returned `PutMappingResponse` allows to retrieve information about the executed
operation as follows:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[put-mapping-response]
--------------------------------------------------
<1> Indicates whether all of the nodes have acknowledged the request

View file

@ -8,6 +8,7 @@ Indices APIs::
* <<java-rest-high-delete-index>>
* <<java-rest-high-open-index>>
* <<java-rest-high-close-index>>
* <<java-rest-high-put-mapping>>
Single document APIs::
* <<java-rest-high-document-index>>