First of all, I have to say great work. I really like your plugin.
I have one issue with multi-line scripts. For maintaining long scripts is deemed necessary to use multi-line scripts for easier visualization. It would great to support multi-line scripts in the plugin. E.g following script is not supported, but works perfectly in Kibana.
POST _scripts/clean-old-profiles
{
"script": {
"lang": "painless",
"source": """
void iterateAllFields(def x) {
if (x instanceof List) {
for (def v: x) {
iterateAllFields(v);
}
}
if (!(x instanceof Map)) {
return;
}
x.entrySet().removeIf(e -> (e.getValue() == "" || e.getValue() == null || ((e.getValue() instanceof List || e.getValue() instanceof Map) && e.getValue().isEmpty())));
for (def v: x.values()) {
iterateAllFields(v);
}
}
ctx.following = null;
ctx.ims = null;
ctx.products = null;
iterateAllFields(ctx);
if (ctx.languages != null) {
for(item in ctx.languages) {
item.remove('isProfileLanguage');
}
}
if (ctx.emails != null) {
for(item in ctx.emails) {
item.remove('probability');
}
}
"""
}
}
Hi @AntonShuvaev,
First of all, I have to say great work. I really like your plugin.
I have one issue with multi-line scripts. For maintaining long scripts is deemed necessary to use multi-line scripts for easier visualization. It would great to support multi-line scripts in the plugin. E.g following script is not supported, but works perfectly in Kibana.