2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2018-05-19 00:26:26 -04:00
|
|
|
[[breaking_70_scripting_changes]]
|
|
|
|
=== Scripting changes
|
|
|
|
|
2019-04-08 21:54:29 -04:00
|
|
|
//NOTE: The notable-breaking-changes tagged regions are re-used in the
|
|
|
|
//Installation and Upgrade Guide
|
|
|
|
|
|
|
|
//tag::notable-breaking-changes[]
|
|
|
|
|
|
|
|
// end::notable-breaking-changes[]
|
|
|
|
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2018-05-19 00:26:26 -04:00
|
|
|
==== 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)`.
|
2018-05-30 08:00:07 -04:00
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2018-10-03 11:56:18 -04:00
|
|
|
==== Accessing missing document values will throw an error
|
|
|
|
`doc['field'].value` will throw an exception if
|
|
|
|
the document is missing a value for the field `field`.
|
|
|
|
|
|
|
|
To check if a document is missing a value, you can use
|
|
|
|
`doc['field'].size() == 0`.
|
|
|
|
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2019-05-28 14:16:18 -04:00
|
|
|
[[script-errors-return-400-error-codes]]
|
2018-05-30 08:00:07 -04:00
|
|
|
==== 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.
|
2018-12-14 07:56:47 -05:00
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2018-12-14 07:56:47 -05:00
|
|
|
==== getValues() removed
|
|
|
|
|
|
|
|
The `ScriptDocValues#getValues()` method is deprecated in 6.6 and will
|
|
|
|
be removed in 7.0. Use `doc["foo"]` in place of `doc["foo"].values`.
|