77 lines
1.4 KiB
YAML
77 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:
|
|
update:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
body:
|
|
doc: { foo: baz }
|
|
upsert: { foo: bar }
|
|
|
|
- do:
|
|
get:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
fields: _timestamp
|
|
|
|
- is_true: _timestamp
|
|
|
|
# milliseconds since epoch
|
|
|
|
- do:
|
|
update:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
body:
|
|
doc: { foo: baz }
|
|
upsert: { foo: bar }
|
|
timestamp: 1372011280000
|
|
|
|
- do:
|
|
get:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
fields: _timestamp
|
|
|
|
- match: { _timestamp: 1372011280000 }
|
|
|
|
# date format
|
|
|
|
- do:
|
|
update:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
body:
|
|
doc: { foo: baz }
|
|
upsert: { foo: bar }
|
|
timestamp: 2013-06-23T18:14:40
|
|
|
|
- do:
|
|
get:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
fields: _timestamp
|
|
|
|
- match: { _timestamp: 1372011280000 }
|
|
|