2013-06-28 13:44:13 -04:00
|
|
|
---
|
2013-07-25 05:16:54 -04:00
|
|
|
"Metadata Fields":
|
2013-06-28 13:44:13 -04:00
|
|
|
|
|
|
|
- skip:
|
2015-04-21 13:03:36 -04:00
|
|
|
version: "all"
|
2013-07-23 14:42:20 -04:00
|
|
|
reason: "Update doesn't return metadata fields, waiting for #3259"
|
2013-06-28 13:44:13 -04:00
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.create:
|
|
|
|
index: test_1
|
|
|
|
body:
|
|
|
|
mappings:
|
|
|
|
test:
|
|
|
|
_parent: { type: "foo" }
|
|
|
|
_timestamp:
|
|
|
|
enabled: 1
|
|
|
|
_ttl:
|
|
|
|
enabled: 1
|
|
|
|
default: 10s
|
|
|
|
|
|
|
|
- do:
|
|
|
|
cluster.health:
|
|
|
|
wait_for_status: yellow
|
|
|
|
|
|
|
|
- do:
|
|
|
|
update:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
parent: 5
|
|
|
|
fields: [ _parent, _routing, _timestamp, _ttl ]
|
|
|
|
body:
|
|
|
|
doc: { foo: baz }
|
|
|
|
upsert: { foo: bar }
|
|
|
|
|
Rest: Add all meta fields to the top level json document.
Some of our meta fields (such as _id, _version, ...) are returned as top-level
properties of the json document, while other properties (_timestamp, _routing,
...) are returned under `fields`. This commit makes all meta fields returned
as top-level properties.
So eg. `GET test/test/1?fields=_timestamp,foo` would now return
```json
{
"_index": "test",
"_type": "test",
"_id": "1",
"_version": 1,
"_timestamp": 10000000,
"found": true,
"fields": {
"foo": [ "bar" ]
}
}
```
while it used to return
```json
{
"_index": "test",
"_type": "test",
"_id": "1",
"_version": 1,
"found": true,
"fields": {
"_timestamp": 10000000,
"foo": [ "bar" ]
}
}
```
2014-10-17 06:35:20 -04:00
|
|
|
- match: { get._parent: "5" }
|
|
|
|
- match: { get._routing: "5" }
|
|
|
|
- is_true: get._timestamp
|
|
|
|
- is_true: get._ttl
|
2013-06-28 13:44:13 -04:00
|
|
|
|
|
|
|
- do:
|
|
|
|
get:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
parent: 5
|
|
|
|
fields: [ _parent, _routing, _timestamp, _ttl ]
|
|
|
|
|
|
|
|
|