diff options
author | Catalin Ursachi <catalin.ursachi@softwire.com> | 2017-12-07 10:39:59 +0000 |
---|---|---|
committer | Luca Cavanna <javanna@users.noreply.github.com> | 2017-12-07 11:39:59 +0100 |
commit | f823cea79c5fc2cd6375cde3782a2e355439c57a (patch) | |
tree | f0220fec7d06baa28d7c6ddf9e4d4420f220b6c8 /docs | |
parent | 0b102f63721472d7de89c21c78c9210aed90e7de (diff) |
Added Create Index support to high-level REST client (#27351)
Relates to #27205
Diffstat (limited to 'docs')
4 files changed, 100 insertions, 1 deletions
diff --git a/docs/java-rest/high-level/apis/createindex.asciidoc b/docs/java-rest/high-level/apis/createindex.asciidoc new file mode 100644 index 0000000000..ebd9158e19 --- /dev/null +++ b/docs/java-rest/high-level/apis/createindex.asciidoc @@ -0,0 +1,97 @@ +[[java-rest-high-create-index]] +=== Create Index API + +[[java-rest-high-create-index-request]] +==== Create Index Request + +A `CreateIndexRequest` requires an `index` argument: + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request] +-------------------------------------------------- +<1> The index to create + +==== Index settings +Each index created can have specific settings associated with it. + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request-settings] +-------------------------------------------------- +<1> Settings for this index + +==== Index mappings +An index may be created with mappings for its document types + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request-mappings] +-------------------------------------------------- +<1> The type to define +<2> The mapping for this type, provided as a JSON string + +==== Index aliases +Aliases can be set at index creation time + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request-aliases] +-------------------------------------------------- +<1> The alias to define + +==== Optional arguments +The following arguments can optionally be provided: + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-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 creatiom as a `String` + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request-masterTimeout] +-------------------------------------------------- +<1> Timeout to connect to the master node as a `TimeValue` +<2> Timeout to connect to the master node as a `String` + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-request-waitForActiveShards] +-------------------------------------------------- +<1> The number of active shard copies to wait for before proceeding with the operation, as an `int`. +<2> The number of active shard copies to wait for before proceeding with the operation, as an `ActiveShardCount`. + +[[java-rest-high-create-index-sync]] +==== Synchronous Execution + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-execute] +-------------------------------------------------- + +[[java-rest-high-create-index-async]] +==== Asynchronous Execution + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-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-create-index-response]] +==== Create Index Response + +The returned `CreateIndexResponse` allows to retrieve information about the executed + operation as follows: + +["source","java",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[create-index-response] +-------------------------------------------------- +<1> Indicates whether all of the nodes have acknowledged the request +<2> Indicates whether the requisite number of shard copies were started for each shard in the index before timing out diff --git a/docs/java-rest/high-level/apis/deleteindex.asciidoc b/docs/java-rest/high-level/apis/deleteindex.asciidoc index 3c0627de49..e256790cf9 100644 --- a/docs/java-rest/high-level/apis/deleteindex.asciidoc +++ b/docs/java-rest/high-level/apis/deleteindex.asciidoc @@ -65,7 +65,7 @@ The returned `DeleteIndexResponse` allows to retrieve information about the exec -------------------------------------------------- include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-response] -------------------------------------------------- -<1> Indicates whether all of the nodes have acknowledged the request or not +<1> Indicates whether all of the nodes have acknowledged the request If the index was not found, an `ElasticsearchException` will be thrown: diff --git a/docs/java-rest/high-level/apis/index.asciidoc b/docs/java-rest/high-level/apis/index.asciidoc index 993951b5ae..2312f28372 100644 --- a/docs/java-rest/high-level/apis/index.asciidoc +++ b/docs/java-rest/high-level/apis/index.asciidoc @@ -1,3 +1,4 @@ +include::createindex.asciidoc[] include::deleteindex.asciidoc[] include::_index.asciidoc[] include::get.asciidoc[] diff --git a/docs/java-rest/high-level/supported-apis.asciidoc b/docs/java-rest/high-level/supported-apis.asciidoc index 9e902e1715..7a6b55619f 100644 --- a/docs/java-rest/high-level/supported-apis.asciidoc +++ b/docs/java-rest/high-level/supported-apis.asciidoc @@ -4,6 +4,7 @@ The Java High Level REST Client supports the following APIs: Indices APIs:: +* <<java-rest-high-create-index>> * <<java-rest-high-delete-index>> Single document APIs:: |