-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra teamv8.0.0-alpha1
Description
Describe the feature:
Currently in master, the correct way to access a doc value is to do a check on size ( see #32207) to avoid an exception when dealing with missing values: doc['field'].size() > 0
However our examples do not use this form (though the docs mentions that in a paragraph).
Without this check, a document with missing fields can cause a working Painless script to throw an exception which is unexpected.
As discussed in the search/aggs meeting it would be desirable to have an intuitive, short and safe access to the doc value regardless of the existence of the value.
mormegil-cz, Kibnet and teamore
Metadata
Metadata
Assignees
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra teamv8.0.0-alpha1