Class HistogramAggregatorFactory
- java.lang.Object
-
- org.elasticsearch.search.aggregations.AggregatorFactory
-
- org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory<ValuesSource>
-
- org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregatorFactory
-
public final class HistogramAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource>
Constructs the per-shard aggregator instance for histogram aggregation. Selects the numeric or range field implementation based on the field type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregatorFactory
AggregatorFactory.MultiBucketAggregatorWrapper
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory
config
-
Fields inherited from class org.elasticsearch.search.aggregations.AggregatorFactory
factories, metaData, name, parent, queryShardContext
-
-
Constructor Summary
Constructors Constructor Description HistogramAggregatorFactory(java.lang.String name, ValuesSourceConfig<ValuesSource> config, double interval, double offset, BucketOrder order, boolean keyed, long minDocCount, double minBound, double maxBound, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
Method Summary
Modifier and Type Method Description protected Aggregator
createUnmapped(SearchContext searchContext, Aggregator parent, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected Aggregator
doCreateInternal(ValuesSource valuesSource, SearchContext searchContext, Aggregator parent, boolean collectsFromSingleBucket, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
long
minDocCount()
protected ValuesSource
resolveMissingAny(java.lang.Object missing)
This method provides a hook for aggregations that need finer grained control over the ValuesSource selected when the user supplies a missing value and there is no mapped field to infer the type from.-
Methods inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory
createInternal
-
Methods inherited from class org.elasticsearch.search.aggregations.AggregatorFactory
asMultiBucketAggregator, create, doValidate, getParent, name
-
-
-
-
Constructor Detail
-
HistogramAggregatorFactory
public HistogramAggregatorFactory(java.lang.String name, ValuesSourceConfig<ValuesSource> config, double interval, double offset, BucketOrder order, boolean keyed, long minDocCount, double minBound, double maxBound, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
resolveMissingAny
protected ValuesSource resolveMissingAny(java.lang.Object missing)
Description copied from class:ValuesSourceAggregatorFactory
This method provides a hook for aggregations that need finer grained control over the ValuesSource selected when the user supplies a missing value and there is no mapped field to infer the type from. This will only be called for aggregations that specify the ValuesSourceType.ANY in their constructors (On the builder class). The user supplied object is passed as a parameter, so its type may be inspected as needed. Generally, only the type of the returned ValuesSource is used, so returning the EMPTY instance of the chosen type is recommended.- Overrides:
resolveMissingAny
in classValuesSourceAggregatorFactory<ValuesSource>
- Parameters:
missing
- The user supplied missing value- Returns:
- A ValuesSource instance compatible with the supplied parameter
-
minDocCount
public long minDocCount()
-
doCreateInternal
protected Aggregator doCreateInternal(ValuesSource valuesSource, SearchContext searchContext, Aggregator parent, boolean collectsFromSingleBucket, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
- Specified by:
doCreateInternal
in classValuesSourceAggregatorFactory<ValuesSource>
- Throws:
java.io.IOException
-
createUnmapped
protected Aggregator createUnmapped(SearchContext searchContext, Aggregator parent, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
- Specified by:
createUnmapped
in classValuesSourceAggregatorFactory<ValuesSource>
- Throws:
java.io.IOException
-
-