move extended bounds parse and validate to date hitso factory
This commit is contained in:
parent
587bdcef38
commit
cbb3cc625e
|
@ -245,6 +245,11 @@ public class DateHistogramAggregationBuilder
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(AggregationContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(AggregationContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
|
ExtendedBounds extendedBounds = null;
|
||||||
|
if (this.extendedBounds != null) {
|
||||||
|
// parse any string bounds to longs
|
||||||
|
extendedBounds = this.extendedBounds.parseAndValidate(name, context.searchContext(), config.format());
|
||||||
|
}
|
||||||
return new DateHistogramAggregatorFactory(name, type, config, interval, dateHistogramInterval, offset, order, keyed, minDocCount,
|
return new DateHistogramAggregatorFactory(name, type, config, interval, dateHistogramInterval, offset, order, keyed, minDocCount,
|
||||||
extendedBounds, context, parent, subFactoriesBuilder, metaData);
|
extendedBounds, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,8 +134,7 @@ public final class DateHistogramAggregatorFactory
|
||||||
// code so we won't need to do that
|
// code so we won't need to do that
|
||||||
ExtendedBounds roundedBounds = null;
|
ExtendedBounds roundedBounds = null;
|
||||||
if (extendedBounds != null) {
|
if (extendedBounds != null) {
|
||||||
// parse any string bounds to longs and round them
|
roundedBounds = extendedBounds.round(rounding);
|
||||||
roundedBounds = extendedBounds.parseAndValidate(name, context.searchContext(), config.format()).round(rounding);
|
|
||||||
}
|
}
|
||||||
return new DateHistogramAggregator(name, factories, rounding, offset, order, keyed, minDocCount, roundedBounds, valuesSource,
|
return new DateHistogramAggregator(name, factories, rounding, offset, order, keyed, minDocCount, roundedBounds, valuesSource,
|
||||||
config.format(), context, parent, pipelineAggregators, metaData);
|
config.format(), context, parent, pipelineAggregators, metaData);
|
||||||
|
|
Loading…
Reference in New Issue