在现有索引上启用 Elasticsearch TTL

Elasticsearch TTL enabled on existing index

我找不到关于 Elasticsearch TTL 字段的好文档。我有一个索引,其中已经存储了文档。如果我随后在索引上启用 TTL,新的 TTL 是否适用于现有文档?

同样,如果我稍后修改默认 TTL,新的 TTL 是适用于现有文档还是仅适用于从那时起的新文档?

我不知道我第一次怎么会错过这个,但是 elasticsearch 文档确实解释了这个行为。

来源:http://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-ttl-field.html

You can dynamically update the default value using the put mapping API. It won’t change the _ttl of already indexed documents but will be used for future documents.