Java源码示例:org.elasticsearch.search.aggregations.AggregatorFactories.Builder
示例1
@Override
protected MultiValuesSourceAggregatorFactory<Numeric, ?> innerInnerBuild(
final SearchContext context,
final List<NamedValuesSourceConfigSpec<Numeric>> configs, final MultiValueMode multiValueMode,
final AggregatorFactory<?> parent, final Builder subFactoriesBuilder) throws IOException {
if (this.inputs == null || this.inputs.length != configs.size() - 1) {
throw new IllegalArgumentException(
"[inputs] must have [" + (configs.size() - 1)
+ "] values as much as the number of feature fields: ["
+ this.name
+ "]");
}
return new PredictionAggregatorFactory(this.name, configs, multiValueMode, this.inputs,
context,
parent,
subFactoriesBuilder, this.metaData);
}
示例2
@Override
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(
QueryShardContext context,
ValuesSourceConfig<ValuesSource> config,
AggregatorFactory parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
if (minDepth > maxDepth)
throw new IllegalArgumentException("[minDepth] (" + minDepth + ") must not be greater than [maxDepth] (" +
maxDepth + ")");
if (depth >= 0) {
if (minDepth > depth)
throw new IllegalArgumentException("[minDepth] (" + minDepth + ") must not be greater than [depth] (" +
depth + ")");
minDepth = depth;
maxDepth = depth;
}
return new PathHierarchyAggregatorFactory(
name, config, separator, minDepth, maxDepth, keepBlankPath, order, minDocCount, bucketCountThresholds,
context, parent, subFactoriesBuilder, metaData);
}
示例3
public PredictionAggregatorFactory(final String name,
final List<NamedValuesSourceConfigSpec<Numeric>> configs, final MultiValueMode multiValueMode,
final double[] inputs, final SearchContext context, final AggregatorFactory<?> parent,
final Builder subFactoriesBuilder,
final Map<String, Object> metaData) throws IOException {
super(name, configs, context, parent, subFactoriesBuilder, metaData);
this.multiValueMode = multiValueMode;
this.inputs = inputs;
}
示例4
@Override
protected final MultiValuesSourceAggregatorFactory<VS, ?> doBuild(SearchContext context,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
List<NamedValuesSourceConfigSpec<VS>> configs = resolveConfig(context);
MultiValuesSourceAggregatorFactory<VS, ?> factory = innerBuild(context, configs, parent,
subFactoriesBuilder);
return factory;
}
示例5
private PathHierarchyAggregationBuilder(PathHierarchyAggregationBuilder clone, Builder factoriesBuilder,
Map<String, Object> metaData) {
super(clone, factoriesBuilder, metaData);
separator = clone.separator;
minDepth = clone.minDepth;
maxDepth = clone.maxDepth;
keepBlankPath = clone.keepBlankPath;
depth = clone.depth;
order = clone.order;
minDocCount = clone.minDocCount;
this.bucketCountThresholds = new PathHierarchyAggregator.BucketCountThresholds(clone.bucketCountThresholds);
}
示例6
private DateHierarchyAggregationBuilder(DateHierarchyAggregationBuilder clone, Builder factoriesBuilder,
Map<String, Object> metaData) {
super(clone, factoriesBuilder, metaData);
order = clone.order;
minDocCount = clone.minDocCount;
this.bucketCountThresholds = new DateHierarchyAggregator.BucketCountThresholds(clone.bucketCountThresholds);
}
示例7
private Rounding createRounding(Rounding.DateTimeUnit dateTimeUnit) {
Rounding.Builder tzRoundingBuilder;
tzRoundingBuilder = Rounding.builder(dateTimeUnit);
if (timeZone() != null) {
tzRoundingBuilder.timeZone(timeZone());
}
Rounding rounding = tzRoundingBuilder.build();
return rounding;
}
示例8
@Override
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric> innerBuild(
QueryShardContext context,
ValuesSourceConfig<ValuesSource.Numeric> config,
AggregatorFactory parent,
Builder subFactoriesBuilder) throws IOException {
final List<RoundingInfo> roundingsInfo = buildRoundings();
return new DateHierarchyAggregatorFactory(
name, config, order, roundingsInfo, minDocCount, bucketCountThresholds,
context, parent, subFactoriesBuilder, metaData);
}
示例9
private GeoShapeBuilder(GeoShapeBuilder clone, Builder factoriesBuilder,
Map<String, Object> metaData) {
super(clone, factoriesBuilder, metaData);
output_format = clone.output_format;
must_simplify = clone.must_simplify;
simplify_zoom = clone.simplify_zoom;
simplify_algorithm = clone.simplify_algorithm;
this.bucketCountThresholds = new GeoShapeAggregator.BucketCountThresholds(clone.bucketCountThresholds);
}
示例10
@Override
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(
QueryShardContext queryShardContext,
ValuesSourceConfig<ValuesSource> config,
AggregatorFactory parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
return new GeoShapeAggregatorFactory(
name, config, output_format, must_simplify, simplify_zoom, simplify_algorithm,
bucketCountThresholds, queryShardContext, parent, subFactoriesBuilder, metaData);
}
示例11
protected GeoPointClusteringAggregationBuilder(
GeoPointClusteringAggregationBuilder clone, Builder factoriesBuilder, Map<String, Object> metaData) {
super(clone, factoriesBuilder, metaData);
this.zoom = clone.zoom;
this.radius = clone.radius;
this.extent = clone.extent;
this.ratio = clone.ratio;
this.requiredSize = clone.requiredSize;
this.shardSize = clone.shardSize;
}
示例12
@Override
public AB subAggregations(Builder subFactories) {
throw new AggregationInitializationException("Aggregator [" + name + "] of type [" +
getType() + "] cannot accept sub-aggregations");
}
示例13
protected abstract MultiValuesSourceAggregatorFactory<VS, ?> innerBuild(SearchContext context,
List<NamedValuesSourceConfigSpec<VS>> configs, AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException;
示例14
@Override
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metaData) {
return new PathHierarchyAggregationBuilder(this, factoriesBuilder, metaData);
}
示例15
@Override
protected AggregationBuilder shallowCopy(Builder factoriesBuilder, Map<String, Object> metaData) {
return new DateHierarchyAggregationBuilder(this, factoriesBuilder, metaData);
}
示例16
@Override
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metaData) {
return new GeoShapeBuilder(this, factoriesBuilder, metaData);
}
示例17
@Override
protected AggregationBuilder shallowCopy(Builder factoriesBuilder, Map<String, Object> metaData) {
return new GeoPointClusteringAggregationBuilder(this, factoriesBuilder, metaData);
}