Hi,
How can I add extra filed's when I reindex the documents using Java API?
I tried below code and it doesn't work and fails with below exception
Map<String, Object> params = new HashMap<>();
params.put("newField", "test");
ReindexRequestBuilder builder = ReindexAction.INSTANCE.newRequestBuilder(store.getClient()).source(sourceIndex)
.destination(destIndex);
builder.destination().setVersionType(VersionType.EXTERNAL);
builder.script(
new Script(ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG, "ctx.newfiled = newField",
params));
BulkByScrollResponse bulkByScrollResponse = builder.execute().actionGet();
CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting