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

42 lines
972 B
YAML
Raw Normal View History

---
"Indexed script":
- 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" }
- match: { "error": /ElasticsearchIllegalArgumentException\SUnable\sto\sparse.*/ }
- do:
catch: request
put_script:
id: "1"
lang: "foobar"
body: { "script" : "_score * doc[\"myParent.weight\"].value" }
- match: { "error": /ElasticsearchIllegalArgumentException\Sscript_lang\snot\ssupported/ }