OpenSearch/rest-api-spec/test/update/25_script_upsert.yaml

42 lines
718 B
YAML
Raw Normal View History

2013-06-28 13:44:13 -04:00
---
"Script upsert":
- do:
update:
index: test_1
type: test
id: 1
body:
script: "ctx._source.foo = bar"
params: { bar: 'xxx' }
upsert: { foo: baz }
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: baz }
- do:
update:
index: test_1
type: test
id: 1
body:
script: "ctx._source.foo = bar"
params: { bar: 'xxx' }
upsert: { foo: baz }
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: xxx }