OpenSearch/rest-api-spec/test/mget/20_fields.yaml

110 lines
2.6 KiB
YAML
Raw Normal View History

---
"Fields":
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- do:
cluster.health:
wait_for_status: yellow
- do:
mget:
index: test_1
type: test
body:
docs:
- { _id: 1 }
- { _id: 1, fields: foo }
- { _id: 1, fields: [foo] }
- { _id: 1, fields: [foo, _source] }
- is_false: docs.0.fields
- match: { docs.0._source: { foo: bar }}
2014-01-03 19:21:43 -05:00
- match: { docs.1.fields.foo: [bar] }
- is_false: docs.1._source
2014-01-03 19:21:43 -05:00
- match: { docs.2.fields.foo: [bar] }
- is_false: docs.2._source
2014-01-03 19:21:43 -05:00
- match: { docs.3.fields.foo: [bar] }
- match: { docs.3._source: { foo: bar }}
- do:
mget:
index: test_1
type: test
fields: foo
body:
docs:
- { _id: 1 }
- { _id: 1, fields: foo }
- { _id: 1, fields: [foo] }
- { _id: 1, fields: [foo, _source] }
2014-01-03 19:21:43 -05:00
- match: { docs.0.fields.foo: [bar] }
- is_false: docs.0._source
2014-01-03 19:21:43 -05:00
- match: { docs.1.fields.foo: [bar] }
- is_false: docs.1._source
2014-01-03 19:21:43 -05:00
- match: { docs.2.fields.foo: [bar] }
- is_false: docs.2._source
2014-01-03 19:21:43 -05:00
- match: { docs.3.fields.foo: [bar] }
- match: { docs.3._source: { foo: bar }}
- do:
mget:
index: test_1
type: test
fields: [foo]
body:
docs:
- { _id: 1 }
- { _id: 1, fields: foo }
- { _id: 1, fields: [foo] }
- { _id: 1, fields: [foo, _source] }
2014-01-03 19:21:43 -05:00
- match: { docs.0.fields.foo: [bar] }
- is_false: docs.0._source
2014-01-03 19:21:43 -05:00
- match: { docs.1.fields.foo: [bar] }
- is_false: docs.1._source
2014-01-03 19:21:43 -05:00
- match: { docs.2.fields.foo: [bar] }
- is_false: docs.2._source
2014-01-03 19:21:43 -05:00
- match: { docs.3.fields.foo: [bar] }
- match: { docs.3._source: { foo: bar }}
- do:
mget:
index: test_1
type: test
fields: [foo, _source]
body:
docs:
- { _id: 1 }
- { _id: 1, fields: foo }
- { _id: 1, fields: [foo] }
- { _id: 1, fields: [foo, _source] }
2014-01-03 19:21:43 -05:00
- match: { docs.0.fields.foo: [bar] }
- match: { docs.0._source: { foo: bar }}
2014-01-03 19:21:43 -05:00
- match: { docs.1.fields.foo: [bar] }
- is_false: docs.1._source
2014-01-03 19:21:43 -05:00
- match: { docs.2.fields.foo: [bar] }
- is_false: docs.2._source
2014-01-03 19:21:43 -05:00
- match: { docs.3.fields.foo: [bar] }
- match: { docs.3._source: { foo: bar }}