Skip to content

Allow scripts to handle missing mappings gracefully #22056

@Bargs

Description

@Bargs

Elasticsearch version: 6.0, 5.x
Plugins installed: none
JVM version: 1.8.0_60
OS version: OSX El Capitan

Description of the problem including expected versus actual behavior:

If a script attempts to access a field that does not exist in the mappings of one or more target indices, you'll get an error saying "Field [foo] does not exist in mappings".

Steps to reproduce:

  1. Execute a query with a script field accessing a non-existent field
  2. Observe error response

When querying wildcard index patterns, it's quite possible that some indices will contain mappings that others do not. It would be nice if the user had the option to handle the missing fields gracefully within the script instead of blowing up the entire request.

Metadata

Metadata

Assignees

Labels

:Core/Infra/ScriptingScripting abstractions, Painless, and Mustache>docsGeneral docs changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions