Ryan Ernst dd0084de83 Mappings: Lock down _ttl field
While the parser allowed changing field type settings, these would never
have been serialized.  So this change simply removes parsing using
parseField. Backcompat will still work if a user uploads old settings
(they just would never have worked anyways, so we continue ignoring
them with 1.x, and 2.x will now error).

see #8143
closes #9914
2015-02-27 11:11:04 -08:00

88 lines
1.6 KiB
YAML

---
"TTL":
- skip:
features: gtelte
- 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: { fields._ttl: 10000}
- gt: { fields._ttl: 0}
# milliseconds
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
ttl: 100000
- do:
get:
index: test_1
type: test
id: 1
fields: _ttl
- lte: { fields._ttl: 100000}
- gt: { fields._ttl: 10000}
# 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: { fields._ttl: 20000}
- gt: { fields._ttl: 10000}
# with timestamp
- do:
catch: /AlreadyExpiredException/
index:
index: test_1
type: test
id: 1
body: { foo: bar }
ttl: 20s
timestamp: 2013-06-23T18:14:40