2014-07-14 21:37:55 +08:00
|
|
|
---
|
|
|
|
"Indexed script":
|
|
|
|
|
|
|
|
- do:
|
2014-07-16 17:46:55 +08:00
|
|
|
put_script:
|
2014-07-14 21:37:55 +08:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
body: { "script": "_score * doc[\"myParent.weight\"].value" }
|
|
|
|
- match: { _id: "1" }
|
|
|
|
|
|
|
|
- do:
|
2014-07-16 17:46:55 +08:00
|
|
|
get_script:
|
2014-07-14 21:37:55 +08:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
- match: { "script": "_score * doc[\"myParent.weight\"].value" }
|
|
|
|
|
|
|
|
- do:
|
2014-07-16 17:46:55 +08:00
|
|
|
delete_script:
|
2014-07-14 21:37:55 +08:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
- match: { found: true }
|
|
|
|
- match: { _index: ".scripts" }
|
|
|
|
- match: { _id: "1" }
|
|
|
|
|
|
|
|
- do:
|
|
|
|
catch: request
|
2014-07-16 17:46:55 +08:00
|
|
|
put_script:
|
2014-07-14 21:37:55 +08:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
body: { "script": "_score * foo bar + doc[\"myParent.weight\"].value" }
|
|
|
|
- match: { "error": /ElasticsearchIllegalArgumentException\SUnable\sto\sparse.*/ }
|
|
|
|
|
|
|
|
|
|
|
|
- do:
|
|
|
|
catch: request
|
2014-07-16 17:46:55 +08:00
|
|
|
put_script:
|
2014-07-14 21:37:55 +08:00
|
|
|
id: "1"
|
|
|
|
lang: "foobar"
|
|
|
|
body: { "script" : "_score * doc[\"myParent.weight\"].value" }
|
|
|
|
- match: { "error": /ElasticsearchIllegalArgumentException\Sscript_lang\snot\ssupported/ }
|
|
|
|
|