diff --git a/docs/painless/painless-getting-started.asciidoc b/docs/painless/painless-getting-started.asciidoc index 7948e90991fe1..eec4b57839b2a 100644 --- a/docs/painless/painless-getting-started.asciidoc +++ b/docs/painless/painless-getting-started.asciidoc @@ -55,7 +55,7 @@ GET hockey/_search "script_score": { "script": { "lang": "painless", - "source": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;" + "inline": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;" } } } @@ -77,7 +77,7 @@ GET hockey/_search "total_goals": { "script": { "lang": "painless", - "source": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;" + "inline": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;" } } } @@ -101,7 +101,7 @@ GET hockey/_search "order": "asc", "script": { "lang": "painless", - "source": "doc['first.keyword'].value + ' ' + doc['last.keyword'].value" + "inline": "doc['first.keyword'].value + ' ' + doc['last.keyword'].value" } } } @@ -189,7 +189,7 @@ GET hockey/_search "script_fields": { "birth_year": { "script": { - "source": "doc.born.value.year" + "inline": "doc.born.value.year" } } } @@ -230,7 +230,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "if (ctx._source.last =~ /b/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}" + "inline": "if (ctx._source.last =~ /b/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}" } } ---------------------------------------------------------------- @@ -245,7 +245,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "if (ctx._source.last ==~ /[^aeiou].*[aeiou]/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}" + "inline": "if (ctx._source.last ==~ /[^aeiou].*[aeiou]/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}" } } ---------------------------------------------------------------- @@ -260,7 +260,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "ctx._source.last = /[aeiou]/.matcher(ctx._source.last).replaceAll('')" + "inline": "ctx._source.last = /[aeiou]/.matcher(ctx._source.last).replaceAll('')" } } ---------------------------------------------------------------- @@ -276,7 +276,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "ctx._source.last = /n([aeiou])/.matcher(ctx._source.last).replaceAll('$1')" + "inline": "ctx._source.last = /n([aeiou])/.matcher(ctx._source.last).replaceAll('$1')" } } ---------------------------------------------------------------- @@ -298,7 +298,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "ctx._source.last = ctx._source.last.replaceAll(/[aeiou]/, m -> m.group().toUpperCase(Locale.ROOT))" + "inline": "ctx._source.last = ctx._source.last.replaceAll(/[aeiou]/, m -> m.group().toUpperCase(Locale.ROOT))" } } ---------------------------------------------------------------- @@ -313,7 +313,7 @@ POST hockey/player/_update_by_query { "script": { "lang": "painless", - "source": "ctx._source.last = ctx._source.last.replaceFirst(/[aeiou]/, m -> m.group().toUpperCase(Locale.ROOT))" + "inline": "ctx._source.last = ctx._source.last.replaceFirst(/[aeiou]/, m -> m.group().toUpperCase(Locale.ROOT))" } } ----------------------------------------------------------------