Skip to content

Remove input, support params instead#18287

Merged
rmuir merged 1 commit intoelastic:masterfrom
rmuir:input_goes_params
May 12, 2016
Merged

Remove input, support params instead#18287
rmuir merged 1 commit intoelastic:masterfrom
rmuir:input_goes_params

Conversation

@rmuir
Copy link
Copy Markdown
Contributor

@rmuir rmuir commented May 12, 2016

Users don't need to go thru a input map anymore to do things with painless. They can access _score, doc, ctx, _value etc directly, and those are first-class citizens and optimized to one degree or another to be fast, with any typing (e.g. map) we can use.

So typically this map in most cases only used to access params from the user Because of that I think we should name it exactly that, it makes usage intuitive:

script: "ctx._source.foo = params.bar"
lang: "painless"
params: { 
    bar: 'xxx' 
}

Also I updated some outdated syntax in various places to try to make things better.

@jdconrad
Copy link
Copy Markdown
Contributor

LGTM.

@jdconrad jdconrad mentioned this pull request May 12, 2016
18 tasks
@rmuir rmuir merged commit d3142e3 into elastic:master May 12, 2016
@clintongormley clintongormley changed the title painless: remove input, support params instead Remove input, support params instead May 17, 2016
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Plugin Lang Painless labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement v5.0.0-alpha3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants