OpenSearch/rest-api-spec/test/index/75_ttl.yaml

86 lines
1.5 KiB
YAML
Raw Normal View History

2013-06-23 16:03:05 -04:00
---
"TTL":
2013-06-23 16:03:05 -04:00
- do:
indices.create:
index: test_1
body:
mappings:
test:
_ttl:
enabled: 1
default: 10s
- do:
cluster.health:
wait_for_status: yellow
# blank ttl
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- do:
get:
index: test_1
type: test
id: 1
fields: _ttl
- lte: { _ttl: 10000}
- gt: { _ttl: 0}
2013-06-23 16:03:05 -04:00
# milliseconds
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
2015-05-25 06:48:34 -04:00
ttl: 100000ms
2013-06-23 16:03:05 -04:00
- do:
get:
index: test_1
type: test
id: 1
fields: _ttl
- lte: { _ttl: 100000}
- gt: { _ttl: 10000}
2013-06-23 16:03:05 -04:00
# duration
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
ttl: 20s
- do:
get:
index: test_1
type: test
id: 1
fields: _ttl
- lte: { _ttl: 20000}
- gt: { _ttl: 10000}
2013-06-23 16:03:05 -04:00
# with timestamp
- do:
catch: /already_expired_exception/
2013-06-23 16:03:05 -04:00
index:
index: test_1
type: test
id: 1
body: { foo: bar }
ttl: 20s
timestamp: 2013-06-23T18:14:40