mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 09:54:06 -04:00
Changes:
* Updates the example Painless script to be valid and aligns it with the example in [How to write a script](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html#script-stored-scripts).
* Adds a hidden snippets to delete the script for cleanup.
Relates to https://github.com/elastic/elasticsearch/issues/83038
(cherry picked from commit 3845a41804
)
This commit is contained in:
parent
f788a25aa5
commit
8615ba812e
3 changed files with 19 additions and 12 deletions
|
@ -14,10 +14,7 @@ PUT _scripts/my-stored-script
|
|||
{
|
||||
"script": {
|
||||
"lang": "painless",
|
||||
"source": """
|
||||
TimestampHour date = doc['@timestamp'].value;
|
||||
return date.getHour()
|
||||
"""
|
||||
"source": "Math.log(_score * 2) + params['my_modifier']"
|
||||
}
|
||||
}
|
||||
----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue