SearchRequestBuilder request = getClient().prepareSearch(this.getIndexName())
.setTypes(this.getIndexType())
.setQuery(QueryBuilders.matchAllQuery())
.setSize(0)
.addAggregation(AggregationBuilders.max("latest")
<BUG>.field(BaseNormalizer.UPDATED_AT_FIELD));
SearchResponse response = request.get();
Max max = (Max) response.getAggregations().get("latest");</BUG>
if (max.getValue() > 0) {
date = new DateTime(Double.valueOf(max.getValue()).longValue()).toDate();

SearchRequestBuilder request = getClient().prepareSearch(this.getIndexName())
.setTypes(this.getIndexType())
.setQuery(QueryBuilders.matchAllQuery())
.setSize(0)
.addAggregation(AggregationBuilders.max("latest")
.field(BaseNormalizer.UPDATED_AT_FIELD));
basicProfile.stop(request.toString());
SearchResponse response = request.get();
fullProfile.stop(response.toString());
Max max = (Max) response.getAggregations().get("latest");
if (max.getValue() > 0) {
date = new DateTime(Double.valueOf(max.getValue()).longValue()).toDate();
