Elastic REST 6.4 IndexShrink Error

Index built with:

ResizeRequest request = new ResizeRequest("code-000001", "code-000002");
Settings settings = Settings.builder()
.put("index.number_of_shards", 2)
.put("index.blocks.write", true)
request.setCopySettings(true); // used in CURL doc, no affect on error
request.getTargetIndexRequest().settings(settings); // tried via map also
request.getTargetIndexRequest().alias(new Alias("alias1"));
resizeResponse = ElasticDoc.getRestClient().indices().split(request, RequestOptions.DEFAULT);

Get following error:
//{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"index code-000001 must be read-only to resize index. use "index.blocks.write=true""}],"type":"illegal_state_exception","reason":"index code-000001 must be read-only to resize index. use "index.blocks.write=true""},"status":500}

Environment: Windows 10, 1.8.0_171 JDK

Forgot to mention that the collection inside the Setting instance only shows one instance, so the second put is stepping on the first. Also tried using maps to the same effect.

This error message indicates that you may have missed a step in the instructions, which is to make sure the index is in read-only mode.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.