Skip to content

Commit 5f05978

Browse files
committed
Add HLRC docs
1 parent fe987aa commit 5f05978

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,9 +1683,13 @@ public void testShrinkIndex() throws Exception {
16831683
request.setWaitForActiveShards(2); // <1>
16841684
request.setWaitForActiveShards(ActiveShardCount.DEFAULT); // <2>
16851685
// end::shrink-index-request-waitForActiveShards
1686+
// tag::shrink-index-request-copySettings
1687+
request.setCopySettings(Boolean.TRUE); // <1>
1688+
// end::shrink-index-request-copySettings
16861689
// tag::shrink-index-request-settings
16871690
request.getTargetIndexRequest().settings(Settings.builder()
1688-
.put("index.number_of_shards", 2)); // <1>
1691+
.put("index.number_of_shards", 2) // <1>
1692+
.putNull("index.routing.allocation.require._name")); // <2>
16891693
// end::shrink-index-request-settings
16901694
// tag::shrink-index-request-aliases
16911695
request.getTargetIndexRequest().alias(new Alias("target_alias")); // <1>

docs/java-rest/high-level/indices/shrink_index.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,21 @@ returns a response, as an `int`
4747
<2> The number of active shard copies to wait for before the shrink index API
4848
returns a response, as an `ActiveShardCount`
4949

50+
["source","java",subs="attributes,callouts,macros"]
51+
--------------------------------------------------
52+
include-tagged::{doc-tests-file}[{api}-request-copySettings]
53+
--------------------------------------------------
54+
<1> Use `Boolean.TRUE` to copy the settings from the source index to the target
55+
index. This cannot be `Boolean.FALSE`. If this method is not used, default behavior is not to copy.
56+
This parameter will be removed in 8.0.0.
57+
5058
["source","java",subs="attributes,callouts,macros"]
5159
--------------------------------------------------
5260
include-tagged::{doc-tests-file}[{api}-request-settings]
5361
--------------------------------------------------
5462
<1> The settings to apply to the target index, which include the number of
5563
shards to create for it
64+
<2> Remove the allocation requirement copied from the source index
5665

5766
["source","java",subs="attributes,callouts,macros"]
5867
--------------------------------------------------

0 commit comments

Comments
 (0)