I created a stored script in elasticsearch
GET _scripts/xxx-script
{
"_id": "xxx-script",
"found": true,
"script": {
"lang": "painless",
"source": "ctx._source.a = params.a;ctx._source.b = params.b;ctx._source.c = params.c;ctx._source.d = params.d;ctx._source.e = params.@timestamp;"
}
}
Then i try to save or update my data into a index, here is my code:
Map<String, String> map = new HashMap<>();
map.put("es.mapping.id", "_id");
map.put(ConfigurationOptions.ES_WRITE_OPERATION, "upsert");
map.put(ConfigurationOptions.ES_UPDATE_SCRIPT_PARAMS, "a:a,b:b,c:c,d:d,@timestamp:for_update_time");
map.put(ConfigurationOptions.ES_UPDATE_SCRIPT_STORED, "xxx-script");
JavaEsSparkSQL.saveToEs(repartition, outputIndex, map);
It always reports this error
circuit_breaking_exception: [script] Too many dynamic script compilations within, max: [1000/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.context.update.max_compilations_rate]
How to solve it?
Thank you