OpenSearch/rest-api-spec/test/script/10_basic.yaml

57 lines
1.2 KiB
YAML
Raw Normal View History

---
"Indexed script":
- skip:
features: groovy_scripting
- do:
put_script:
id: "1"
lang: "groovy"
body: { "script": "_score * doc[\"myParent.weight\"].value" }
- match: { _id: "1" }
- do:
get_script:
id: "1"
lang: "groovy"
- match: { "script": "_score * doc[\"myParent.weight\"].value" }
- do:
delete_script:
id: "1"
lang: "groovy"
- match: { found: true }
- match: { _index: ".scripts" }
- match: { _id: "1" }
- do:
catch: request
put_script:
id: "1"
lang: "groovy"
body: { "script": "_score * foo bar + doc[\"myParent.weight\"].value" }
- do:
catch: /ElasticsearchIllegalArgumentException.Unable.to.parse.*/
put_script:
id: "1"
lang: "groovy"
body: { "script": "_score * foo bar + doc[\"myParent.weight\"].value" }
- do:
catch: request
put_script:
id: "1"
lang: "foobar"
body: { "script" : "_score * doc[\"myParent.weight\"].value" }
- do:
catch: /ElasticsearchIllegalArgumentException.script_lang.not.supported/
put_script:
id: "1"
lang: "foobar"
body: { "script" : "_score * doc[\"myParent.weight\"].value" }