Christoph Büscher 1ea9f11b03
Change ScriptException status to 400 (bad request) (#30861)
Currently failures to compile a script usually lead to a ScriptException, which
inherits the 500 INTERNAL_SERVER_ERROR from ElasticsearchException if it does
not contain another root cause. Instead, this should be a 400 Bad Request error.
This PR changes this more generally for script compilation errors by changing 
ScriptException to return 400 (bad request) as status code.

Closes #12315
2018-05-30 14:00:07 +02:00

20 lines
900 B
Plaintext

[[breaking_70_scripting_changes]]
=== Scripting changes
==== getDate() and getDates() removed
Fields of type `long` and `date` had `getDate()` and `getDates()` methods
(for multi valued fields) to get an object with date specific helper methods
for the current doc value. In 5.3.0, `date` fields were changed to expose
this same date object directly when calling `doc["myfield"].value`, and
the getter methods for date objects were deprecated. These methods have
now been removed. Instead, use `.value` on `date` fields, or explicitly
parse `long` fields into a date object using
`Instance.ofEpochMillis(doc["myfield"].value)`.
==== Script errors will return as `400` error codes
Malformed scripts, either in search templates, ingest pipelines or search
requests, return `400 - Bad request` while they would previously return
`500 - Internal Server Error`. This also applies for stored scripts.