Skip to content

Commit

Permalink
Add deprecation logging for _timestamp and _ttl. #19031
Browse files Browse the repository at this point in the history
  • Loading branch information
jpountz committed Jun 23, 2016
1 parent b874291 commit cf87545
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ private synchronized DocumentMapper merge(DocumentMapper mapper, MergeReason rea
logger.warn("Type [{}] starts with a '.', it is recommended not to start a type name with a '.'", mapper.type());
}
}
if (reason == MergeReason.MAPPING_UPDATE) {
if (mapper.timestampFieldMapper().enabled()) {
deprecationLogger.deprecated("[_timestamp] will be removed in 5.0. As a replacement, you should explicitly populate a date "
+ "field with the current timestamp in your documents.");
}
if (mapper.TTLFieldMapper().enabled()) {
deprecationLogger.deprecated("[_ttl] will be removed in 5.0. As a replacement, you should use time based indexes or cron "
+ "a delete-by-query with a range query on a timestamp field.");
}
}

// 1. compute the merged DocumentMapper
DocumentMapper oldMapper = mappers.get(mapper.type());
Expand Down

0 comments on commit cf87545

Please sign in to comment.