Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation logging for _timestamp and _ttl. #19031

Merged
merged 1 commit into from
Jun 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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