Skip to content

Painless doc access#18262

Merged
rmuir merged 3 commits intoelastic:masterfrom
rmuir:painless_doc_access
May 11, 2016
Merged

Painless doc access#18262
rmuir merged 3 commits intoelastic:masterfrom
rmuir:painless_doc_access

Conversation

@rmuir
Copy link
Copy Markdown
Contributor

@rmuir rmuir commented May 11, 2016

Currently access to a document works only as input.doc['field'].value.

It would be much better to support doc['field'].value like the other scripting engines.

I plan to also followup with ctx and _value reserved words, too. After we've done these, I think we should rename input to params as that will be its general use, just accessing script parameters.

This change is the simplest step, it just treats doc as a def type. It is at least a small perf improvement on its own.

Later, we can try to improve its type safety, ultimately treating it as a Map<String,ScriptDocValues> which will potentially allow us to avoid tons of dynamic shit for what really should not be dynamic...

@jdconrad
Copy link
Copy Markdown
Contributor

LGTM. Thanks!

@rmuir rmuir merged commit 2e4f87d into elastic:master May 11, 2016
@jdconrad jdconrad mentioned this pull request May 12, 2016
18 tasks
@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