Class DateHistogramAggregatorFactory
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactory
org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory<ValuesSource>
org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory
public final class DateHistogramAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource>
-
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 DateHistogramAggregatorFactory(java.lang.String name, ValuesSourceConfig<ValuesSource> config, long offset, BucketOrder order, boolean keyed, long minDocCount, Rounding rounding, Rounding shardRounding, ExtendedBounds extendedBounds, 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 Details
-
DateHistogramAggregatorFactory
public DateHistogramAggregatorFactory(java.lang.String name, ValuesSourceConfig<ValuesSource> config, long offset, BucketOrder order, boolean keyed, long minDocCount, Rounding rounding, Rounding shardRounding, ExtendedBounds extendedBounds, 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 Details
-
minDocCount
public long minDocCount() -
resolveMissingAny
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 CoreValuesSourceType.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
-
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
-