Package org.elasticsearch.search.aggregations

Examples of org.elasticsearch.search.aggregations.HasAggregations


      Terms termAggregation = (Terms) aggregation;
      for (Terms.Bucket value : termAggregation.getBuckets()) {
        this.facets.put(aggregation.getName().replace("_selected",""), new FacetValue(value.getKey(), value.getDocCount()));
      }
    } else if (HasAggregations.class.isAssignableFrom(aggregation.getClass())) {
      HasAggregations hasAggregations = (HasAggregations) aggregation;
      for (Aggregation internalAggregation : hasAggregations.getAggregations()) {
        this.processAggregation(internalAggregation);
      }
    } else {
      LOGGER.warn("Cannot process {} type of aggregation", aggregation.getClass());
    }
View Full Code Here


     *
     * @param root  The root that serves as a point of reference for this path
     * @return      The resolved value
     */
    public double resolveValue(HasAggregations root) {
        HasAggregations parent = root;
        double value = Double.NaN;
        for (int i = 0; i < tokens.length; i++) {
            OrderPath.Token token = tokens[i];
            Aggregation agg = parent.getAggregations().get(token.name);

            if (agg == null) {
                throw new ElasticsearchIllegalArgumentException("Invalid order path [" + this +
                        "]. Cannot find aggregation named [" + token.name + "]");
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.search.aggregations.HasAggregations

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.