OpenSearch/rest-api-spec/test/index/70_timestamp.yaml

72 lines
1.3 KiB
YAML
Raw Normal View History

2013-06-23 16:03:05 -04:00
---
"Timestamp":
2013-06-23 16:03:05 -04:00
- do:
indices.create:
index: test_1
body:
mappings:
test:
_timestamp:
enabled: 1
store: yes
- do:
cluster.health:
wait_for_status: yellow
# blank timestamp
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- do:
get:
index: test_1
type: test
id: 1
fields: _timestamp
- is_true: _timestamp
2013-06-23 16:03:05 -04:00
# milliseconds since epoch
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
timestamp: 1372011280000
- do:
get:
index: test_1
type: test
id: 1
fields: _timestamp
- match: { _timestamp: 1372011280000 }
2013-06-23 16:03:05 -04:00
# date format
- do:
index:
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: { _timestamp: 1372011280000 }
2013-06-23 16:03:05 -04:00