mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 05:58:44 +00:00
f1f3b28f5c
* Adds deprecation logging to ScriptDocValues#getValues. First commit addressing issue #22919. `ScriptDocValues#getValues` was added for backwards compatibility but no longer needed. Scripts using the syntax `doc['foo'].values` when `doc['foo']` is a list should be using `doc['foo']` instead. * Fixes two build errors in #34279 * Removes unused import in ScriptDocValuesDatesTest * Removes used of `.values` in example in diversified-sampler-aggregation.asciidoc * Removes use of .values from painless test. Part of #34279 * Updates tests to use `doc[foo]` syntax rather than `doc[foo].values`. * Removes use of `getValues()` and replaces use of `doc[foo].values` with `doc[foo]`. * Indentation fix. * Remove unnecessary list construction at previous `getValues()` callsite in ScriptDocValues.GeoPoints. * Update migration doc and add link to `getValue` in ScriptDocValues javadoc. * Fix compile * Fix javadoc issue * Removes ScriptDocValues#getValues usage from painless whitelist.
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
[float]
|
|
[[breaking_70_scripting_changes]]
|
|
=== Scripting changes
|
|
|
|
[float]
|
|
==== 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)`.
|
|
|
|
[float]
|
|
==== 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`.
|
|
|
|
|
|
[float]
|
|
==== 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.
|
|
|
|
[float]
|
|
==== 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`.
|