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());
}