當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。