Ryan Ernst 97d2657e18 Remove script access to term statistics (#19462)
In scripts (at least some of the languages), the terms dictionary and
postings can be access with the special _index variable. This is for
very advanced use cases which want to do their own scoring. The problem
is segment level statistics must be recomputed for every document.
Additionally, this is not friendly to the terms index caching as the
order of looking up terms should be controlled by lucene.

This change removes _index from scripts. Anyone using it can and should
instead write a Similarity plugin, which is explicitly designed to allow
doing the calculations needed for a relevance score.

closes #19359
2017-05-16 09:10:09 -07:00

24 lines
910 B
Plaintext

[[breaking_60_scripting_changes]]
=== Scripting changes
==== Groovy, JavaScript, and Python languages removed
The Groovy, JavaScript, and Python scripting languages were deprecated in
elasticsearch 5.0 and have now been removed. Use painless instead.
==== Date fields now return dates
`doc.some_date_field.value` now returns ++ReadableDateTime++s instead of
milliseconds since epoch as a `long`. The same is true for
`doc.some_date_field[some_number]`. Use `doc.some_date_field.value.millis` to
fetch the milliseconds since epoch if you need it.
==== Removed access to index internal via the _index variable
The `_index` variable has been removed. If you used it for advanced scoring, consider writing a `Similarity` plugin.
==== Script Settings
All of the existing scripting security settings have been deprecated. Instead
they are replaced with `script.allowed_types` and `script.allowed_contexts`.