Skip to content

Commit

Permalink
docs renamed ( indices_aliases -> update_aliases )
Browse files Browse the repository at this point in the history
  • Loading branch information
olcbean committed Jan 25, 2018
1 parent f0cfab8 commit 28a8dc6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,40 +463,40 @@ public void testIndicesAliases() throws IOException {
}

{
// tag::indices-aliases-request
// tag::update-aliases-request
IndicesAliasesRequest request = new IndicesAliasesRequest(); // <1>
AliasActions aliasAction = new AliasActions(AliasActions.Type.ADD).index("index1").alias("alias1"); // <2>
request.addAliasAction(aliasAction); // <3>
// end::indices-aliases-request
// end::update-aliases-request

// tag::indices-aliases-request2
// tag::update-aliases-request2
AliasActions addIndexAction = new AliasActions(AliasActions.Type.ADD).index("index1").alias("alias1")
.filter("{\"term\":{\"year\":2016}}"); // <1>
AliasActions addIndicesAction = new AliasActions(AliasActions.Type.ADD).indices("index1", "index2").alias("alias2")
.routing("1"); // <2>
AliasActions removeAction = new AliasActions(AliasActions.Type.REMOVE).index("index3").alias("alias3"); // <3>
AliasActions removeIndexAction = new AliasActions(AliasActions.Type.REMOVE_INDEX).index("index4"); // <4>
// end::indices-aliases-request2
// end::update-aliases-request2

// tag::indices-aliases-request-timeout
// tag::update-aliases-request-timeout
request.timeout(TimeValue.timeValueMinutes(2)); // <1>
request.timeout("2m"); // <2>
// end::indices-aliases-request-timeout
// tag::indices-aliases-request-masterTimeout
// end::update-aliases-request-timeout
// tag::update-aliases-request-masterTimeout
request.masterNodeTimeout(TimeValue.timeValueMinutes(1)); // <1>
request.masterNodeTimeout("1m"); // <2>
// end::indices-aliases-request-masterTimeout
// end::update-aliases-request-masterTimeout

// tag::indices-aliases-execute
// tag::update-aliases-execute
IndicesAliasesResponse indicesAliasesResponse = client.indices().updateAliases(request);
// end::indices-aliases-execute
// end::update-aliases-execute

// tag::indices-aliases-response
// tag::update-aliases-response
boolean acknowledged = indicesAliasesResponse.isAcknowledged(); // <1>
// end::indices-aliases-response
// end::update-aliases-response
assertTrue(acknowledged);

// tag::indices-aliases-execute-async
// tag::update-aliases-execute-async
client.indices().updateAliasesAsync(request, new ActionListener<IndicesAliasesResponse>() {
@Override
public void onResponse(IndicesAliasesResponse indciesAliasesResponse) {
Expand All @@ -508,7 +508,7 @@ public void onFailure(Exception e) {
// <2>
}
});
// end::indices-aliases-execute-async
// end::update-aliases-execute-async
}
}
}
2 changes: 1 addition & 1 deletion docs/java-rest/high-level/apis/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include::close_index.asciidoc[]

include::putmapping.asciidoc[]

include::indices_aliases.asciidoc[]
include::update_aliases.asciidoc[]

include::_index.asciidoc[]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[[java-rest-high-indices-aliases]]
[[java-rest-high-update-aliases]]
=== Update Aliases API

[[java-rest-high-indices-aliases-request]]
==== Index Aliases Request
[[java-rest-high-update-aliases-request]]
==== Indices Aliases Request

The Update Aliases API allows aliasing an index with a name, with all APIs
automatically converting the alias name to the actual index name.
Expand All @@ -11,7 +11,7 @@ An `IndicesAliasesRequest` must have at least one `AliasActions`:

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-request]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-request]
--------------------------------------------------
<1> Creates an `IndicesAliasesRequest`
<2> Creates an `AliasActions` that aliases index `test1` with `alias1`
Expand All @@ -23,7 +23,7 @@ index.

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-request2]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-request2]
--------------------------------------------------
<1> Creates an alias `alias1` with an optional filter on field `year`
<2> Creates an alias `alias2` associated with two indices and with an optional routing
Expand All @@ -35,45 +35,45 @@ The following arguments can optionally be provided:

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-request-timeout]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-request-timeout]
--------------------------------------------------
<1> Timeout to wait for the all the nodes to acknowledge the operation as a `TimeValue`
<2> Timeout to wait for the all the nodes to acknowledge the operation as a `String`

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-request-masterTimeout]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-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-indices-aliases-sync]]
[[java-rest-high-update-aliases-sync]]
==== Synchronous Execution

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-execute]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-execute]
--------------------------------------------------

[[java-rest-high-indices-aliases-async]]
[[java-rest-high-update-aliases-async]]
==== Asynchronous Execution

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-execute-async]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-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-indices-aliases-response]]
[[java-rest-high-update-aliases-response]]
==== Indices Aliases Response

The returned `IndicesAliasesResponse` allows to retrieve information about the
executed operation as follows:

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[indices-aliases-response]
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[update-aliases-response]
--------------------------------------------------
<1> Indicates whether all of the nodes have acknowledged the request
2 changes: 1 addition & 1 deletion docs/java-rest/high-level/supported-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Indices APIs::
* <<java-rest-high-open-index>>
* <<java-rest-high-close-index>>
* <<java-rest-high-put-mapping>>
* <<java-rest-high-indices-aliases>>
* <<java-rest-high-update-aliases>>

Single document APIs::
* <<java-rest-high-document-index>>
Expand Down

0 comments on commit 28a8dc6

Please sign in to comment.