/** * Validate a bucket ordering strategy for an {@link Aggregator}. * * @param order bucket ordering strategy to sort on. * @param aggregator aggregator to sort. * @return unmodified bucket ordering strategy. * @throws AggregationExecutionException if validation fails */ public static BucketOrder validate(BucketOrder order, Aggregator aggregator) throws AggregationExecutionException { if (order instanceof CompoundOrder) { for (BucketOrder innerOrder : ((CompoundOrder) order).orderElements) { validate(innerOrder, aggregator); } } else if (order instanceof Aggregation) { ((Aggregation) order).path().validate(aggregator); } return order; }
public static Terms.Order validate(Terms.Order order, Aggregator termsAggregator) { if (order instanceof CompoundOrder) { for (Terms.Order innerOrder : ((CompoundOrder)order).orderElements) { validate(innerOrder, termsAggregator); } return order; } else if (!(order instanceof Aggregation)) { return order; } AggregationPath path = ((Aggregation) order).path(); path.validate(termsAggregator); return order; }
public static Terms.Order validate(Terms.Order order, Aggregator termsAggregator) { if (order instanceof CompoundOrder) { for (Terms.Order innerOrder : ((CompoundOrder)order).orderElements) { validate(innerOrder, termsAggregator); } return order; } else if (!(order instanceof Aggregation)) { return order; } AggregationPath path = ((Aggregation) order).path(); path.validate(termsAggregator); return order; }
/** * Validate a bucket ordering strategy for an {@link Aggregator}. * * @param order bucket ordering strategy to sort on. * @param aggregator aggregator to sort. * @return unmodified bucket ordering strategy. * @throws AggregationExecutionException if validation fails */ public static BucketOrder validate(BucketOrder order, Aggregator aggregator) throws AggregationExecutionException { if (order instanceof CompoundOrder) { for (BucketOrder innerOrder : ((CompoundOrder) order).orderElements) { validate(innerOrder, aggregator); } } else if (order instanceof Aggregation) { ((Aggregation) order).path().validate(aggregator); } return order; }
/** * Validate a bucket ordering strategy for an {@link Aggregator}. * * @param order bucket ordering strategy to sort on. * @param aggregator aggregator to sort. * @return unmodified bucket ordering strategy. * @throws AggregationExecutionException if validation fails */ public static BucketOrder validate(BucketOrder order, Aggregator aggregator) throws AggregationExecutionException { if (order instanceof CompoundOrder) { for (BucketOrder innerOrder : ((CompoundOrder) order).orderElements) { validate(innerOrder, aggregator); } } else if (order instanceof Aggregation) { ((Aggregation) order).path().validate(aggregator); } return order; }