2013-06-26 16:04:20 -04:00
|
|
|
---
|
|
|
|
"TTL":
|
2013-07-01 09:58:23 -04:00
|
|
|
|
2014-03-31 09:10:24 -04:00
|
|
|
- skip:
|
|
|
|
features: gtelte
|
|
|
|
|
2013-06-26 16:04:20 -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:
|
2013-06-26 16:18:14 -04:00
|
|
|
create:
|
2013-06-26 16:04:20 -04:00
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
body: { foo: bar }
|
|
|
|
|
|
|
|
- do:
|
|
|
|
get:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
fields: _ttl
|
2013-07-01 09:58:23 -04:00
|
|
|
|
2014-03-31 09:10:24 -04:00
|
|
|
- lte: { fields._ttl: 10000}
|
2013-06-26 16:04:20 -04:00
|
|
|
- gt: { fields._ttl: 0}
|
|
|
|
|
|
|
|
# milliseconds
|
|
|
|
|
|
|
|
- do:
|
2013-06-26 16:18:14 -04:00
|
|
|
delete:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
- do:
|
|
|
|
create:
|
2013-06-26 16:04:20 -04:00
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
body: { foo: bar }
|
|
|
|
ttl: 100000
|
|
|
|
- do:
|
|
|
|
get:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
fields: _ttl
|
2013-07-01 09:58:23 -04:00
|
|
|
|
2014-03-31 09:10:24 -04:00
|
|
|
- lte: { fields._ttl: 100000}
|
2013-06-26 16:04:20 -04:00
|
|
|
- gt: { fields._ttl: 10000}
|
|
|
|
|
|
|
|
# duration
|
|
|
|
|
|
|
|
- do:
|
2013-06-26 16:18:14 -04:00
|
|
|
delete:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
- do:
|
|
|
|
create:
|
2013-06-26 16:04:20 -04:00
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
body: { foo: bar }
|
|
|
|
ttl: 20s
|
|
|
|
|
|
|
|
- do:
|
|
|
|
get:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
fields: _ttl
|
2013-07-01 09:58:23 -04:00
|
|
|
|
2014-03-31 09:10:24 -04:00
|
|
|
- lte: { fields._ttl: 20000}
|
2013-06-26 16:04:20 -04:00
|
|
|
- gt: { fields._ttl: 10000}
|
|
|
|
|
|
|
|
# with timestamp
|
|
|
|
|
2013-06-26 16:18:14 -04:00
|
|
|
- do:
|
|
|
|
delete:
|
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
2013-06-26 16:04:20 -04:00
|
|
|
- do:
|
|
|
|
catch: /AlreadyExpiredException/
|
2013-06-26 16:18:14 -04:00
|
|
|
create:
|
2013-06-26 16:04:20 -04:00
|
|
|
index: test_1
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
body: { foo: bar }
|
|
|
|
ttl: 20s
|
|
|
|
timestamp: 2013-06-23T18:14:40
|
|
|
|
|