org.elasticsearch.common.util.BytesRefHash Java Examples

The following examples show how to use org.elasticsearch.common.util.BytesRefHash. 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: FreqTermsEnum.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public FreqTermsEnum(IndexReader reader, String field, boolean needDocFreq, boolean needTotalTermFreq, @Nullable Query filter, BigArrays bigArrays) throws IOException {
    super(reader, field, needTotalTermFreq ? PostingsEnum.FREQS : PostingsEnum.NONE, filter);
    this.bigArrays = bigArrays;
    this.needDocFreqs = needDocFreq;
    this.needTotalTermFreqs = needTotalTermFreq;
    if (needDocFreq) {
        termDocFreqs = bigArrays.newIntArray(INITIAL_NUM_TERM_FREQS_CACHED, false);
    } else {
        termDocFreqs = null;
    }
    if (needTotalTermFreq) {
        termsTotalFreqs = bigArrays.newLongArray(INITIAL_NUM_TERM_FREQS_CACHED, false);
    } else {
        termsTotalFreqs = null;
    }
    cachedTermOrds = new BytesRefHash(INITIAL_NUM_TERM_FREQS_CACHED, bigArrays);
}
 
Example #2
Source File: DateHierarchyAggregator.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
public DateHierarchyAggregator(
        String name,
        AggregatorFactories factories,
        SearchContext context,
        ValuesSource.Numeric valuesSource,
        BucketOrder order,
        long minDocCount,
        BucketCountThresholds bucketCountThresholds,
        List<DateHierarchyAggregationBuilder.RoundingInfo> roundingsInfo,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData
) throws IOException {
    super(name, factories, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.roundingsInfo = roundingsInfo;
    this.minDocCount = minDocCount;
    bucketOrds =  new BytesRefHash(1, context.bigArrays());
    this.order = InternalOrder.validate(order, this);
    this.bucketCountThresholds = bucketCountThresholds;
}
 
Example #3
Source File: PathHierarchyAggregator.java    From elasticsearch-aggregation-pathhierarchy with MIT License 6 votes vote down vote up
public PathHierarchyAggregator(
        String name,
        AggregatorFactories factories,
        SearchContext context,
        ValuesSource valuesSource,
        BucketOrder order,
        long minDocCount,
        BucketCountThresholds bucketCountThresholds,
        BytesRef separator,
        int minDepth,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData
) throws IOException {
    super(name, factories, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.separator = separator;
    this.minDocCount = minDocCount;
    bucketOrds = new BytesRefHash(1, context.bigArrays());
    this.order = InternalOrder.validate(order, this);
    this.bucketCountThresholds = bucketCountThresholds;
    this.minDepth = minDepth;
}
 
Example #4
Source File: GeoShapeAggregator.java    From elasticsearch-plugin-geoshape with MIT License 6 votes vote down vote up
public GeoShapeAggregator(
        String name,
        AggregatorFactories factories,
        SearchContext context,
        ValuesSource valuesSource,
        InternalGeoShape.OutputFormat output_format,
        boolean must_simplify,
        int zoom,
        GeoShape.Algorithm algorithm,
        BucketCountThresholds bucketCountThresholds,
        Aggregator parent,
        List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData
) throws IOException {
    super(name, factories, context, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.output_format = output_format;
    this.must_simplify = must_simplify;
    this.zoom = zoom;
    this.algorithm = algorithm;
    bucketOrds = new BytesRefHash(1, context.bigArrays());
    this.bucketCountThresholds = bucketCountThresholds;

    this.wkbReader = new WKBReader();
    this.geometryFactory = new GeometryFactory();
}
 
Example #5
Source File: StringTermsAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public StringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource,
        Terms.Order order, BucketCountThresholds bucketCountThresholds,
        IncludeExclude.StringFilter 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;
    bucketOrds = new BytesRefHash(1, aggregationContext.bigArrays());
}
 
Example #6
Source File: DiversifiedMapSamplerAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public DiversifiedMapSamplerAggregator(String name, int shardSize, AggregatorFactories factories,
        AggregationContext aggregationContext, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData,
        ValuesSource valuesSource, int maxDocsPerValue) throws IOException {
    super(name, shardSize, factories, aggregationContext, parent, pipelineAggregators, metaData);
    this.valuesSource = valuesSource;
    this.maxDocsPerValue = maxDocsPerValue;
    bucketOrds = new BytesRefHash(shardSize, aggregationContext.bigArrays());

}
 
Example #7
Source File: ParentIdsFilter.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
private ParentIdsFilter(String parentType, BitSetProducer nonNestedDocsFilter, BytesRefHash parentIds) {
    this.nonNestedDocsFilter = nonNestedDocsFilter;
    this.parentTypeBr = new BytesRef(parentType);
    this.parentIds = parentIds;
}