Package org.elasticsearch.search.aggregations.metrics.max

Examples of org.elasticsearch.search.aggregations.metrics.max.Max


      .addAggregation(AggregationBuilders.max("latest")
        .field(BaseNormalizer.UPDATED_AT_FIELD));

    SearchResponse response = request.get();

    Max max = response.getAggregations().get("latest");
    if (max.getValue() > 0) {
      Date date = new DateTime(Double.valueOf(max.getValue()).longValue()).toDate();
      LOG.debug("Index {}:{} has last update of {}", this.getIndexName(), this.getIndexType(), date);
      return date;
    } else {
      LOG.debug("Index {}:{} has no last update date", this.getIndexName(), this.getIndexType());
      return null;
View Full Code Here

TOP

Related Classes of org.elasticsearch.search.aggregations.metrics.max.Max

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.