OpenSearch/rest-api-spec/test/update/50_parent.yaml

80 lines
1.4 KiB
YAML
Raw Normal View History

2013-06-28 13:44:13 -04:00
---
setup:
2013-06-28 13:44:13 -04:00
- do:
indices.create:
index: test_1
body:
mappings:
test:
_parent: { type: "foo" }
- do:
cluster.health:
wait_for_status: yellow
---
"Parent":
- do:
catch: /routing_missing_exception/
update:
index: test_1
type: test
id: 1
body:
doc: { foo: baz }
upsert: { foo: bar }
2013-06-28 13:44:13 -04:00
- do:
update:
index: test_1
type: test
id: 1
2015-02-09 07:18:42 -05:00
parent: 5
2013-06-28 13:44:13 -04:00
body:
doc: { foo: baz }
2015-02-09 07:18:42 -05:00
upsert: { foo: bar }
2013-06-28 13:44:13 -04:00
- do:
get:
index: test_1
type: test
id: 1
parent: 5
fields: [_parent, _routing]
- match: { _parent: "5"}
- match: { _routing: "5"}
2013-06-28 13:44:13 -04:00
- do:
update:
index: test_1
type: test
id: 1
2015-02-09 07:18:42 -05:00
parent: 5
fields: foo
2013-06-28 13:44:13 -04:00
body:
doc: { foo: baz }
2014-01-03 19:21:43 -05:00
- match: { get.fields.foo: [baz] }
---
"Parent omitted":
2013-06-28 13:44:13 -04:00
- do:
index:
2013-06-28 13:44:13 -04:00
index: test_1
type: test
id: 1
parent: 5
body: { foo: bar }
- do:
catch: request
update:
index: test_1
type: test
id: 1
2013-06-28 13:44:13 -04:00
body:
doc: { foo: baz }