当前位置: 首页>>代码示例>>Java>>正文


Java Numeric类代码示例

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


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

示例1: createInternal

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
public Aggregator createInternal(final Aggregator parent, final boolean collectsFromSingleBucket,
    final List<PipelineAggregator> pipelineAggregators, final Map<String, Object> metaData)
    throws IOException {
  final List<Numeric> featuresValuesSources = new ArrayList<>(this.featureConfigs.size());
  for (final ValuesSourceConfig<Numeric> featureConfig : this.featureConfigs) {
    Numeric source = featureConfig.toValuesSource(this.context.getQueryShardContext());
    if (source == null) {
      source = Numeric.EMPTY;
    }
    featuresValuesSources.add(source);
  }
  Numeric responseSource = this.responseConfig
      .toValuesSource(this.context.getQueryShardContext());
  if (responseSource == null) {
    responseSource = Numeric.EMPTY;
  }
  return doCreateInternal(featuresValuesSources, responseSource, parent, collectsFromSingleBucket,
      pipelineAggregators, metaData);
}
 
开发者ID:scaleborn,项目名称:elasticsearch-linear-regression,代码行数:21,代码来源:BaseAggregatorFactory.java

示例2: innerInnerBuild

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@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);
}
 
开发者ID:scaleborn,项目名称:elasticsearch-linear-regression,代码行数:18,代码来源:PredictionAggregationBuilder.java

示例3: innerBuild

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
        AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
    switch (method) {
    case TDIGEST:
        return new TDigestPercentileRanksAggregatorFactory(name, config, values, compression, keyed, context, parent,
                subFactoriesBuilder, metaData);
    case HDR:
        return new HDRPercentileRanksAggregatorFactory(name, config, values, numberOfSignificantValueDigits, keyed, context,
                parent, subFactoriesBuilder, metaData);
    default:
        throw new IllegalStateException("Illegal method [" + method + "]");
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:PercentileRanksAggregationBuilder.java

示例4: innerBuild

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
        AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
    switch (method) {
    case TDIGEST:
        return new TDigestPercentilesAggregatorFactory(name, config, percents, compression, keyed, context, parent,
                subFactoriesBuilder, metaData);
    case HDR:
        return new HDRPercentilesAggregatorFactory(name, config, percents, numberOfSignificantValueDigits, keyed, context, parent,
                subFactoriesBuilder, metaData);
    default:
        throw new IllegalStateException("Illegal method [" + method + "]");
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:PercentilesAggregationBuilder.java

示例5: HDRPercentilesAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public HDRPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
        int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.percents = percents;
    this.numberOfSignificantValueDigits = numberOfSignificantValueDigits;
    this.keyed = keyed;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:HDRPercentilesAggregatorFactory.java

示例6: HDRPercentileRanksAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public HDRPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] values,
        int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.values = values;
    this.numberOfSignificantValueDigits = numberOfSignificantValueDigits;
    this.keyed = keyed;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:HDRPercentileRanksAggregatorFactory.java

示例7: TDigestPercentilesAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public TDigestPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
        double compression, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.percents = percents;
    this.compression = compression;
    this.keyed = keyed;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:TDigestPercentilesAggregatorFactory.java

示例8: TDigestPercentileRanksAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public TDigestPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
        double compression, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.percents = percents;
    this.compression = compression;
    this.keyed = keyed;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:TDigestPercentileRanksAggregatorFactory.java

示例9: AbstractRangeAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public AbstractRangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, R[] ranges, boolean keyed,
        InternalRange.Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.ranges = ranges;
    this.keyed = keyed;
    this.rangeFactory = rangeFactory;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:AbstractRangeAggregatorFactory.java

示例10: innerBuild

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
protected RangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
        AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
    // We need to call processRanges here so they are parsed before we make the decision of whether to cache the request
    Range[] ranges = processRanges(context, config);
    return new RangeAggregatorFactory(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder,
            metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:RangeAggregationBuilder.java

示例11: innerBuild

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
protected DateRangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
        AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
    // We need to call processRanges here so they are parsed and we know whether `now` has been used before we make 
    // the decision of whether to cache the request
    Range[] ranges = processRanges(context, config);
    return new DateRangeAggregatorFactory(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder,
            metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:DateRangeAggregationBuilder.java

示例12: processRanges

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
/**
 * Resolve any strings in the ranges so we have a number value for the from
 * and to of each range. The ranges are also sorted before being returned.
 */
protected Range[] processRanges(SearchContext context, ValuesSourceConfig<Numeric> config) {
    Range[] ranges = new Range[this.ranges.size()];
    for (int i = 0; i < ranges.length; i++) {
        ranges[i] = this.ranges.get(i).process(config.format(), context);
    }
    sortRanges(ranges);
    return ranges;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:AbstractRangeBuilder.java

示例13: DoubleTermsAggregator

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public DoubleTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, DocValueFormat format,
        Terms.Order order, BucketCountThresholds bucketCountThresholds, SearchContext aggregationContext, Aggregator parent,
        SubAggCollectionMode collectionMode, boolean showTermDocCountError, IncludeExclude.LongFilter longFilter,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, factories, valuesSource, format, order, bucketCountThresholds, aggregationContext, parent, collectionMode,
            showTermDocCountError, longFilter, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:DoubleTermsAggregator.java

示例14: doCreateInternal

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
@Override
protected Aggregator doCreateInternal(ValuesSource valuesSource, Aggregator parent, boolean collectsFromSingleBucket,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

    if (valuesSource instanceof ValuesSource.Numeric) {
        return new DiversifiedNumericSamplerAggregator(name, shardSize, factories, context, parent, pipelineAggregators, metaData,
                (Numeric) valuesSource, maxDocsPerValue);
    }

    if (valuesSource instanceof ValuesSource.Bytes) {
        ExecutionMode execution = null;
        if (executionHint != null) {
            execution = ExecutionMode.fromString(executionHint);
        }

        // In some cases using ordinals is just not supported: override
        // it
        if (execution == null) {
            execution = ExecutionMode.GLOBAL_ORDINALS;
        }
        if ((execution.needsGlobalOrdinals()) && (!(valuesSource instanceof ValuesSource.Bytes.WithOrdinals))) {
            execution = ExecutionMode.MAP;
        }
        return execution.create(name, factories, shardSize, maxDocsPerValue, valuesSource, context, parent, pipelineAggregators,
                metaData);
    }

    throw new AggregationExecutionException("Sampler aggregation cannot be applied to field [" + config.fieldContext().field()
            + "]. It can only be applied to numeric or string fields.");
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:31,代码来源:DiversifiedAggregatorFactory.java

示例15: DateHistogramAggregatorFactory

import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; //导入依赖的package包/类
public DateHistogramAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, long interval,
        DateHistogramInterval dateHistogramInterval, long offset, InternalOrder order, boolean keyed, long minDocCount,
        Rounding rounding, ExtendedBounds extendedBounds, SearchContext context, AggregatorFactory<?> parent,
        AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
    super(name, config, context, parent, subFactoriesBuilder, metaData);
    this.interval = interval;
    this.dateHistogramInterval = dateHistogramInterval;
    this.offset = offset;
    this.order = order;
    this.keyed = keyed;
    this.minDocCount = minDocCount;
    this.extendedBounds = extendedBounds;
    this.rounding = rounding;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:DateHistogramAggregatorFactory.java


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