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


Java SearchContext.bigArrays方法代码示例

本文整理汇总了Java中org.elasticsearch.search.internal.SearchContext.bigArrays方法的典型用法代码示例。如果您正苦于以下问题:Java SearchContext.bigArrays方法的具体用法?Java SearchContext.bigArrays怎么用?Java SearchContext.bigArrays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.search.internal.SearchContext的用法示例。


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

示例1: StatsAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public StatsAggregator(String name, ValuesSource.Numeric valuesSource, DocValueFormat format,
        SearchContext context,
                       Aggregator parent, List<PipelineAggregator> pipelineAggregators,
                       Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    if (valuesSource != null) {
        final BigArrays bigArrays = context.bigArrays();
        counts = bigArrays.newLongArray(1, true);
        sums = bigArrays.newDoubleArray(1, true);
        mins = bigArrays.newDoubleArray(1, false);
        mins.fill(0, mins.size(), Double.POSITIVE_INFINITY);
        maxes = bigArrays.newDoubleArray(1, false);
        maxes.fill(0, maxes.size(), Double.NEGATIVE_INFINITY);
    }
    this.format = format;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:StatsAggregator.java

示例2: ExtendedStatsAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public ExtendedStatsAggregator(String name, ValuesSource.Numeric valuesSource, DocValueFormat formatter,
        SearchContext context, Aggregator parent, double sigma, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData)
        throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.format = formatter;
    this.sigma = sigma;
    if (valuesSource != null) {
        final BigArrays bigArrays = context.bigArrays();
        counts = bigArrays.newLongArray(1, true);
        sums = bigArrays.newDoubleArray(1, true);
        mins = bigArrays.newDoubleArray(1, false);
        mins.fill(0, mins.size(), Double.POSITIVE_INFINITY);
        maxes = bigArrays.newDoubleArray(1, false);
        maxes.fill(0, maxes.size(), Double.NEGATIVE_INFINITY);
        sumOfSqrs = bigArrays.newDoubleArray(1, true);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:ExtendedStatsAggregator.java

示例3: DateHistogramAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
DateHistogramAggregator(String name, AggregatorFactories factories, Rounding rounding, long offset, InternalOrder order,
        boolean keyed,
        long minDocCount, @Nullable ExtendedBounds extendedBounds, @Nullable ValuesSource.Numeric valuesSource,
        DocValueFormat formatter, SearchContext aggregationContext,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

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

    bucketOrds = new LongHash(1, aggregationContext.bigArrays());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:DateHistogramAggregator.java

示例4: HistogramAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
HistogramAggregator(String name, AggregatorFactories factories, double interval, double offset,
        InternalOrder order, boolean keyed, long minDocCount, double minBound, double maxBound,
        @Nullable ValuesSource.Numeric valuesSource, DocValueFormat formatter,
        SearchContext context, Aggregator parent,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

    super(name, factories, context, parent, pipelineAggregators, metaData);
    if (interval <= 0) {
        throw new IllegalArgumentException("interval must be positive, got: " + interval);
    }
    this.interval = interval;
    this.offset = offset;
    this.order = order;
    this.keyed = keyed;
    this.minDocCount = minDocCount;
    this.minBound = minBound;
    this.maxBound = maxBound;
    this.valuesSource = valuesSource;
    this.formatter = formatter;

    bucketOrds = new LongHash(1, context.bigArrays());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:23,代码来源:HistogramAggregator.java

示例5: prepareBackground

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
/**
 * Creates the TermsEnum (if not already created) and must be called before any calls to getBackgroundFrequency
 * @param context The aggregation context 
 * @return The number of documents in the index (after an optional filter might have been applied)
 */
public long prepareBackground(AggregationContext context) {
    if (termsEnum != null) {
        // already prepared - return 
        return termsEnum.getNumDocs();
    }
    SearchContext searchContext = context.searchContext();
    IndexReader reader = searchContext.searcher().getIndexReader();
    try {
        if (numberOfAggregatorsCreated == 1) {
            // Setup a termsEnum for sole use by one aggregator
            termsEnum = new FilterableTermsEnum(reader, indexedFieldName, PostingsEnum.NONE, filter);
        } else {
            // When we have > 1 agg we have possibility of duplicate term frequency lookups 
            // and so use a TermsEnum that caches results of all term lookups
            termsEnum = new FreqTermsEnum(reader, indexedFieldName, true, false, filter, searchContext.bigArrays());
        }
    } catch (IOException e) {
        throw new ElasticsearchException("failed to build terms enumeration", e);
    }
    return termsEnum.getNumDocs();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:27,代码来源:SignificantTermsAggregatorFactory.java

示例6: TopHitsAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的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

示例7: CardinalityAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public CardinalityAggregator(String name, ValuesSource valuesSource, int precision,
        SearchContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.precision = precision;
    this.counts = valuesSource == null ? null : new HyperLogLogPlusPlus(precision, context.bigArrays(), 1);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:CardinalityAggregator.java

示例8: AvgAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public AvgAggregator(String name, ValuesSource.Numeric valuesSource, DocValueFormat formatter, SearchContext context,
        Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.format = formatter;
    if (valuesSource != null) {
        final BigArrays bigArrays = context.bigArrays();
        counts = bigArrays.newLongArray(1, true);
        sums = bigArrays.newDoubleArray(1, true);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:AvgAggregator.java

示例9: GeoCentroidAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
protected GeoCentroidAggregator(String name, SearchContext context, Aggregator parent,
                                ValuesSource.GeoPoint valuesSource, List<PipelineAggregator> pipelineAggregators,
                                Map<String, Object> metaData) throws IOException {
    super(name, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    if (valuesSource != null) {
        final BigArrays bigArrays = context.bigArrays();
        centroids = bigArrays.newLongArray(1, true);
        counts = bigArrays.newLongArray(1, true);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:GeoCentroidAggregator.java

示例10: WithHash

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public WithHash(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource,
        DocValueFormat format, BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude,
        SearchContext context, Aggregator parent, SignificanceHeuristic significanceHeuristic,
        SignificantTermsAggregatorFactory termsAggFactory, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) throws IOException {
    super(name, factories, valuesSource, format, bucketCountThresholds, includeExclude, context, parent, significanceHeuristic,
            termsAggFactory, pipelineAggregators, metaData);
    bucketOrds = new LongHash(1, context.bigArrays());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:GlobalOrdinalsSignificantTermsAggregator.java

示例11: ParentToChildrenAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public ParentToChildrenAggregator(String name, AggregatorFactories factories, SearchContext context,
                                  Aggregator parent, String parentType, Query childFilter, Query parentFilter,
                                  ValuesSource.Bytes.WithOrdinals.ParentChild valuesSource,
        long maxOrd, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
    super(name, factories, context, parent, pipelineAggregators, metaData);
    this.parentType = parentType;
    // these two filters are cached in the parser
    this.childFilter = context.searcher().createNormalizedWeight(childFilter, false);
    this.parentFilter = context.searcher().createNormalizedWeight(parentFilter, false);
    this.parentOrdToBuckets = context.bigArrays().newLongArray(maxOrd, false);
    this.parentOrdToBuckets.fill(0, maxOrd, -1);
    this.parentOrdToOtherBuckets = new LongObjectPagedHashMap<>(context.bigArrays());
    this.valuesSource = valuesSource;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:ParentToChildrenAggregator.java

示例12: StringTermsAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public StringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource,
        Terms.Order order, DocValueFormat format, BucketCountThresholds bucketCountThresholds,
        IncludeExclude.StringFilter includeExclude, SearchContext context,
        Aggregator parent, SubAggCollectionMode collectionMode, boolean showTermDocCountError,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {

    super(name, factories, context, parent, order, format, bucketCountThresholds, collectionMode, showTermDocCountError,
            pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.includeExclude = includeExclude;
    bucketOrds = new BytesRefHash(1, context.bigArrays());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:StringTermsAggregator.java

示例13: LongTermsAggregator

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

示例14: WithHash

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
public WithHash(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals valuesSource, Terms.Order order,
        DocValueFormat format, BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude,
        SearchContext context, Aggregator parent, SubAggCollectionMode collectionMode,
        boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
                throws IOException {
    super(name, factories, valuesSource, order, format, bucketCountThresholds, includeExclude, context, parent, collectionMode,
            showTermDocCountError, pipelineAggregators, metaData);
    bucketOrds = new LongHash(1, context.bigArrays());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:GlobalOrdinalsStringTermsAggregator.java

示例15: DiversifiedMapSamplerAggregator

import org.elasticsearch.search.internal.SearchContext; //导入方法依赖的package包/类
DiversifiedMapSamplerAggregator(String name, int shardSize, AggregatorFactories factories,
        SearchContext context, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData,
        ValuesSource valuesSource, int maxDocsPerValue) throws IOException {
    super(name, shardSize, factories, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.maxDocsPerValue = maxDocsPerValue;
    bucketOrds = new BytesRefHash(shardSize, context.bigArrays());

}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:DiversifiedMapSamplerAggregator.java


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