org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory Java Examples

The following examples show how to use org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PathHierarchyAggregationBuilder.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
@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);
}
 
Example #2
Source File: DateHierarchyAggregationBuilder.java    From elasticsearch-aggregation-pathhierarchy with MIT License 5 votes vote down vote up
@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);
}
 
Example #3
Source File: GeoShapeBuilder.java    From elasticsearch-plugin-geoshape with MIT License 5 votes vote down vote up
@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);
}