OpenSearch/plugins/lang-javascript/rest-api-spec/test/lang_javascript/10_basic.yaml

27 lines
565 B
YAML
Raw Normal View History

2015-07-07 13:19:58 -04:00
# Integration tests for Lang JavaScript components
#
setup:
- do:
index:
index: test
type: test
id: 1
body: { "foo": "aaa" }
- do:
indices.refresh: {}
---
"Lang JavaScript":
- do:
search:
body:
script_fields:
bar:
lang: javascript
script: "doc['foo'].value + x"
params:
x: "bbb"
- match: { hits.hits.0.fields.bar.0: "aaabbb"}