2014-07-14 09:37:55 -04:00
|
|
|
---
|
|
|
|
"Indexed script":
|
|
|
|
|
2015-02-12 12:07:42 -05:00
|
|
|
- skip:
|
|
|
|
features: groovy_scripting
|
|
|
|
|
2014-07-14 09:37:55 -04:00
|
|
|
- do:
|
2014-07-16 05:46:55 -04:00
|
|
|
put_script:
|
2014-07-14 09:37:55 -04:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
body: { "script": "_score * doc[\"myParent.weight\"].value" }
|
|
|
|
- match: { _id: "1" }
|
|
|
|
|
|
|
|
- do:
|
2014-07-16 05:46:55 -04:00
|
|
|
get_script:
|
2014-07-14 09:37:55 -04:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
2015-04-02 10:48:37 -04:00
|
|
|
- match: { found: true }
|
|
|
|
- match: { lang: groovy }
|
|
|
|
- match: { _id: "1" }
|
|
|
|
- match: { _version: 1 }
|
2014-07-14 09:37:55 -04:00
|
|
|
- match: { "script": "_score * doc[\"myParent.weight\"].value" }
|
|
|
|
|
2015-04-02 10:48:37 -04:00
|
|
|
- do:
|
|
|
|
catch: missing
|
|
|
|
get_script:
|
|
|
|
id: "2"
|
|
|
|
lang: "groovy"
|
|
|
|
- match: { found: false }
|
|
|
|
- match: { lang: groovy }
|
|
|
|
- match: { _id: "2" }
|
|
|
|
- is_false: _version
|
|
|
|
- is_false: script
|
|
|
|
|
2014-07-14 09:37:55 -04:00
|
|
|
- do:
|
2014-07-16 05:46:55 -04:00
|
|
|
delete_script:
|
2014-07-14 09:37:55 -04:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
- match: { found: true }
|
|
|
|
- match: { _index: ".scripts" }
|
|
|
|
- match: { _id: "1" }
|
2015-04-02 10:48:37 -04:00
|
|
|
- match: { _version: 2 }
|
|
|
|
|
|
|
|
- do:
|
|
|
|
catch: missing
|
|
|
|
delete_script:
|
|
|
|
id: "non_existing"
|
|
|
|
lang: "groovy"
|
|
|
|
- match: { found: false }
|
|
|
|
- match: { _index: ".scripts" }
|
|
|
|
- match: { _id: "non_existing" }
|
|
|
|
- match: { _version: 1 }
|
2014-07-14 09:37:55 -04:00
|
|
|
|
|
|
|
- do:
|
|
|
|
catch: request
|
2014-07-16 05:46:55 -04:00
|
|
|
put_script:
|
2014-07-14 09:37:55 -04:00
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
body: { "script": "_score * foo bar + doc[\"myParent.weight\"].value" }
|
|
|
|
|
|
|
|
|
2014-07-16 11:30:18 -04:00
|
|
|
- do:
|
2015-04-24 03:36:10 -04:00
|
|
|
catch: /Unable.to.parse.*/
|
2014-07-16 11:30:18 -04:00
|
|
|
put_script:
|
|
|
|
id: "1"
|
|
|
|
lang: "groovy"
|
|
|
|
body: { "script": "_score * foo bar + doc[\"myParent.weight\"].value" }
|
|
|
|
|
2014-07-14 09:37:55 -04:00
|
|
|
- do:
|
|
|
|
catch: request
|
2014-07-16 05:46:55 -04:00
|
|
|
put_script:
|
2014-07-14 09:37:55 -04:00
|
|
|
id: "1"
|
|
|
|
lang: "foobar"
|
|
|
|
body: { "script" : "_score * doc[\"myParent.weight\"].value" }
|
2014-07-16 11:30:18 -04:00
|
|
|
|
|
|
|
- do:
|
2015-04-24 03:36:10 -04:00
|
|
|
catch: /script_lang.not.supported/
|
2014-07-16 11:30:18 -04:00
|
|
|
put_script:
|
|
|
|
id: "1"
|
|
|
|
lang: "foobar"
|
|
|
|
body: { "script" : "_score * doc[\"myParent.weight\"].value" }
|
2014-07-14 09:37:55 -04:00
|
|
|
|