OpenSearch/rest-api-spec/test/create/70_timestamp.yaml
Adrien Grand f4ee3f25e4 Mappings: Store _timestamp by default.
Storing `_timestamp` by default means that under the default configuration, you
would have all the information you need in order to reindex into a different
index.

Close #8139
2014-10-20 12:17:26 +02:00

81 lines
1.4 KiB
YAML

---
"Timestamp":
- do:
indices.create:
index: test_1
body:
mappings:
test:
_timestamp:
enabled: 1
- do:
cluster.health:
wait_for_status: yellow
# blank timestamp
- do:
create:
index: test_1
type: test
id: 1
body: { foo: bar }
- do:
get:
index: test_1
type: test
id: 1
fields: _timestamp
- is_true: fields._timestamp
# milliseconds since epoch
- do:
delete:
index: test_1
type: test
id: 1
- do:
create:
index: test_1
type: test
id: 1
body: { foo: bar }
timestamp: 1372011280000
- do:
get:
index: test_1
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }
# date format
- do:
delete:
index: test_1
type: test
id: 1
- do:
create:
index: test_1
type: test
id: 1
body: { foo: bar }
timestamp: 2013-06-23T18:14:40
- do:
get:
index: test_1
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }