• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PipelineAggregator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.elasticsearch.search.aggregations.pipeline.PipelineAggregator的典型用法代码示例。如果您正苦于以下问题:Java PipelineAggregator类的具体用法?Java PipelineAggregator怎么用?Java PipelineAggregator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PipelineAggregator类属于org.elasticsearch.search.aggregations.pipeline包,在下文中一共展示了PipelineAggregator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createInternal

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
public Aggregator createInternal(Aggregator parent, boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators,
                                 Map<String, Object> metaData) throws IOException {
    HashMap<String, VS> valuesSources = new HashMap<>();

    for (Map.Entry<String, ValuesSourceConfig<VS>> config : configs.entrySet()) {
        VS vs = config.getValue().toValuesSource(context.getQueryShardContext());
        if (vs != null) {
            valuesSources.put(config.getKey(), vs);
        }
    }
    if (valuesSources.isEmpty()) {
        return createUnmapped(parent, pipelineAggregators, metaData);
    }
    return doCreateInternal(valuesSources, parent, collectsFromSingleBucket, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:MultiValuesSourceAggregatorFactory.java


示例2: HistogramAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public HistogramAggregator(String name, AggregatorFactories factories, Rounding rounding, InternalOrder order, boolean keyed,
        long minDocCount, @Nullable ExtendedBounds extendedBounds, @Nullable ValuesSource.Numeric valuesSource,
        ValueFormatter formatter, InternalHistogram.Factory<?> histogramFactory, AggregationContext aggregationContext,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

    super(name, factories, aggregationContext, parent, pipelineAggregators, metaData);
    this.rounding = rounding;
    this.order = order;
    this.keyed = keyed;
    this.minDocCount = minDocCount;
    this.extendedBounds = extendedBounds;
    this.valuesSource = valuesSource;
    this.formatter = formatter;
    this.histogramFactory = histogramFactory;

    bucketOrds = new LongHash(1, aggregationContext.bigArrays());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:HistogramAggregator.java


示例3: ScriptedMetricAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
protected ScriptedMetricAggregator(String name, Script initScript, Script mapScript, Script combineScript, Script reduceScript,
        Map<String, Object> params, AggregationContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.params = params;
    ScriptService scriptService = context.searchContext().scriptService();
    if (initScript != null) {
        scriptService.executable(initScript, ScriptContext.Standard.AGGS, context.searchContext(), Collections.<String, String>emptyMap()).run();
    }
    this.mapScript = scriptService.search(context.searchContext().lookup(), mapScript, ScriptContext.Standard.AGGS, Collections.<String, String>emptyMap());
    if (combineScript != null) {
        this.combineScript = scriptService.executable(combineScript, ScriptContext.Standard.AGGS, context.searchContext(), Collections.<String, String>emptyMap());
    } else {
        this.combineScript = null;
    }
    this.reduceScript = reduceScript;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:ScriptedMetricAggregator.java


示例4: createInternal

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
protected PipelineAggregator createInternal(Map<String, Object> metaData) throws IOException {
    DocValueFormat formatter;
    if (format != null) {
        formatter = new DocValueFormat.Decimal(format);
    } else {
        formatter = DocValueFormat.RAW;
    }
    Long xAxisUnits = null;
    if (units != null) {
        DateTimeUnit dateTimeUnit = DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(units);
        if (dateTimeUnit != null) {
            xAxisUnits = dateTimeUnit.field(DateTimeZone.UTC).getDurationField().getUnitMillis();
        } else {
            TimeValue timeValue = TimeValue.parseTimeValue(units, null, getClass().getSimpleName() + ".unit");
            if (timeValue != null) {
                xAxisUnits = timeValue.getMillis();
            }
        }
    }
    return new DerivativePipelineAggregator(name, bucketsPaths, formatter, gapPolicy, xAxisUnits, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:23,代码来源:DerivativePipelineAggregationBuilder.java


示例5: createTestInstance

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
protected InternalHistogram createTestInstance(String name, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) {
    final boolean keyed = randomBoolean();
    final DocValueFormat format = DocValueFormat.RAW;
    final int base = randomInt(50) - 30;
    final int numBuckets = randomInt(10);
    final int interval = randomIntBetween(1, 3);
    List<InternalHistogram.Bucket> buckets = new ArrayList<>();
    for (int i = 0; i < numBuckets; ++i) {
        final int docCount = TestUtil.nextInt(random(), 1, 50);
        buckets.add(new InternalHistogram.Bucket(base + i * interval, docCount, keyed, format, InternalAggregations.EMPTY));
    }
    return new InternalHistogram(name, buckets, (InternalOrder) InternalHistogram.Order.KEY_ASC,
            1, null, format, keyed, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:InternalHistogramTests.java


示例6: reduce

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
public InternalAggregation reduce(InternalAggregation aggregation, ReduceContext reduceContext) {
    InternalHistogram histo = (InternalHistogram) aggregation;
    List<? extends InternalHistogram.Bucket> buckets = histo.getBuckets();
    InternalHistogram.Factory<? extends InternalHistogram.Bucket> factory = histo.getFactory();

    List newBuckets = new ArrayList<>();
    double sum = 0;
    for (InternalHistogram.Bucket bucket : buckets) {
        Double thisBucketValue = resolveBucketValue(histo, bucket, bucketsPaths()[0], GapPolicy.INSERT_ZEROS);
        sum += thisBucketValue;
        List<InternalAggregation> aggs = new ArrayList<>(eagerTransform(bucket.getAggregations().asList(),
                AGGREGATION_TRANFORM_FUNCTION));
        aggs.add(new InternalSimpleValue(name(), sum, formatter, new ArrayList<PipelineAggregator>(), metaData()));
        InternalHistogram.Bucket newBucket = factory.createBucket(bucket.getKey(), bucket.getDocCount(),
                new InternalAggregations(aggs), bucket.getKeyed(), bucket.getFormatter());
        newBuckets.add(newBucket);
    }
    return factory.create(newBuckets, histo);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:CumulativeSumPipelineAggregator.java


示例7: FiltersAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public FiltersAggregator(String name, AggregatorFactories factories, String[] keys, Weight[] filters, boolean keyed, String otherBucketKey,
        AggregationContext aggregationContext,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    super(name, factories, aggregationContext, parent, pipelineAggregators, metaData);
    this.keyed = keyed;
    this.keys = keys;
    this.filters = filters;
    this.showOtherBucket = otherBucketKey != null;
    this.otherBucketKey = otherBucketKey;
    if (showOtherBucket) {
        this.totalNumKeys = keys.length + 1;
    } else {
        this.totalNumKeys = keys.length;
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:FiltersAggregator.java


示例8: createInternal

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
public Aggregator createInternal(AggregationContext context, Aggregator parent, boolean collectsFromSingleBucket,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    if (collectsFromSingleBucket == false) {
        return asMultiBucketAggregator(this, context, parent);
    }
    Map<String, Object> params = this.params;
    if (params != null) {
        params = deepCopyParams(params, context.searchContext());
    } else {
        params = new HashMap<>();
        params.put("_agg", new HashMap<String, Object>());
    }
    return new ScriptedMetricAggregator(name, insertParams(initScript, params), insertParams(mapScript, params), insertParams(
            combineScript, params), deepCopyScript(reduceScript, context.searchContext()), params, context, parent, pipelineAggregators,
            metaData);
    }
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:ScriptedMetricAggregator.java


示例9: InternalMatrixStats

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
/** per shard ctor */
protected InternalMatrixStats(String name, long count, RunningStats multiFieldStatsResults, MatrixStatsResults results,
                              List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    assert count >= 0;
    this.stats = multiFieldStatsResults;
    this.results = results;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:InternalMatrixStats.java


示例10: GlobalOrdinalsStringTermsAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public GlobalOrdinalsStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals valuesSource,
                                              Terms.Order order, BucketCountThresholds bucketCountThresholds,
IncludeExclude.OrdinalsFilter includeExclude,
           AggregationContext aggregationContext, Aggregator parent, SubAggCollectionMode collectionMode, boolean showTermDocCountError,
           List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
       super(name, factories, aggregationContext, parent, order, bucketCountThresholds, collectionMode, showTermDocCountError,
               pipelineAggregators,
               metaData);
       this.valuesSource = valuesSource;
       this.includeExclude = includeExclude;
   }
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:GlobalOrdinalsStringTermsAggregator.java


示例11: ScriptedMetricAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
protected ScriptedMetricAggregator(String name, SearchScript mapScript, ExecutableScript combineScript,
                                   Script reduceScript,
        Map<String, Object> params, SearchContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.params = params;
    this.mapScript = mapScript;
    this.combineScript = combineScript;
    this.reduceScript = reduceScript;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:ScriptedMetricAggregator.java


示例12: create

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
Aggregator create(String name, AggregatorFactories factories, ValuesSource valuesSource, Terms.Order order,
        DocValueFormat format, TermsAggregator.BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude,
        SearchContext context, Aggregator parent, SubAggCollectionMode subAggCollectMode,
        boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
                throws IOException {
    final IncludeExclude.OrdinalsFilter filter = includeExclude == null ? null : includeExclude.convertToOrdinalsFilter(format);
    return new GlobalOrdinalsStringTermsAggregator.WithHash(name, factories, (ValuesSource.Bytes.WithOrdinals) valuesSource,
            order, format, bucketCountThresholds, filter, context, parent, subAggCollectMode, showTermDocCountError,
            pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:TermsAggregatorFactory.java


示例13: create

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
Aggregator create(String name, AggregatorFactories factories, ValuesSource valuesSource, Terms.Order order,
        TermsAggregator.BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude,
        AggregationContext aggregationContext, Aggregator parent, SubAggCollectionMode subAggCollectMode,
        boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
        throws IOException {
    final IncludeExclude.StringFilter filter = includeExclude == null ? null : includeExclude.convertToStringFilter();
    return new StringTermsAggregator(name, factories, valuesSource, order, bucketCountThresholds, filter, aggregationContext,
            parent, subAggCollectMode, showTermDocCountError, pipelineAggregators, metaData);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:TermsAggregatorFactory.java


示例14: LongTerms

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public LongTerms(String name, Terms.Order order, ValueFormatter formatter, int requiredSize, int shardSize, long minDocCount,
        List<? extends InternalTerms.Bucket> buckets, boolean showTermDocCountError, long docCountError, long otherDocCount,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, order, requiredSize, shardSize, minDocCount, buckets, showTermDocCountError, docCountError, otherDocCount, pipelineAggregators,
            metaData);
    this.formatter = formatter;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:LongTerms.java


示例15: InternalGeoBounds

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
InternalGeoBounds(String name, double top, double bottom, double posLeft, double posRight,
                  double negLeft, double negRight, boolean wrapLongitude,
                  List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    this.top = top;
    this.bottom = bottom;
    this.posLeft = posLeft;
    this.posRight = posRight;
    this.negLeft = negLeft;
    this.negRight = negRight;
    this.wrapLongitude = wrapLongitude;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:InternalGeoBounds.java


示例16: doValidate

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
        List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
    if (bucketsPaths.length != 1) {
        throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
                + " must contain a single entry for aggregation [" + name + "]");
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:MaxBucketPipelineAggregationBuilder.java


示例17: TopHitsAggregator

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public TopHitsAggregator(FetchPhase fetchPhase, SubSearchContext subSearchContext, String name, SearchContext context,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.fetchPhase = fetchPhase;
    topDocsCollectors = new LongObjectPagedHashMap<>(1, context.bigArrays());
    this.subSearchContext = subSearchContext;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TopHitsAggregator.java


示例18: createTestInstance

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
protected InternalGeoHashGrid createTestInstance(String name, List<PipelineAggregator> pipelineAggregators,
                                                 Map<String, Object> metaData) {
    int size = randomIntBetween(1, 100);
    List<InternalGeoHashGrid.Bucket> buckets = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        long geoHashAsLong = GeoHashUtils.longEncode(randomInt(90), randomInt(90), 4);
        buckets.add(new InternalGeoHashGrid.Bucket(geoHashAsLong, randomInt(IndexWriter.MAX_DOCS), InternalAggregations.EMPTY));
    }
    return new InternalGeoHashGrid(name, size, buckets, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:InternalGeoHashGridTests.java


示例19: InternalBucketMetricValue

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
public InternalBucketMetricValue(String name, String[] keys, double value, ValueFormatter formatter,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    this.keys = keys;
    this.value = value;
    this.valueFormatter = formatter;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:InternalBucketMetricValue.java


示例20: createInternal

import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; //导入依赖的package包/类
@Override
public Aggregator createInternal(Aggregator parent, boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {
    if (collectsFromSingleBucket == false) {
        return asMultiBucketAggregator(this, context, parent);
    }
    if (childObjectMapper == null) {
        return new Unmapped(name, context, parent, pipelineAggregators, metaData);
    }
    return new NestedAggregator(name, factories, parentObjectMapper, childObjectMapper, context, parent, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:NestedAggregatorFactory.java



注:本文中的org.elasticsearch.search.aggregations.pipeline.PipelineAggregator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormField类代码示例发布时间:2022-05-22
下一篇:
Java ShellException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap