Class ValuesSourceAggregatorFactory<VS extends ValuesSource>
- java.lang.Object
-
- org.elasticsearch.search.aggregations.AggregatorFactory
-
- org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory<VS>
-
- Direct Known Subclasses:
AbstractRangeAggregatorFactory
,AutoDateHistogramAggregatorFactory
,BinaryRangeAggregatorFactory
,DateHistogramAggregatorFactory
,DiversifiedAggregatorFactory
,GeoDistanceRangeAggregatorFactory
,GeoHashGridAggregatorFactory
,GeoTileGridAggregatorFactory
,HistogramAggregatorFactory
,MedianAbsoluteDeviationAggregatorFactory
,MissingAggregatorFactory
,RareTermsAggregatorFactory
,SignificantTermsAggregatorFactory
,TermsAggregatorFactory
public abstract class ValuesSourceAggregatorFactory<VS extends ValuesSource> extends AggregatorFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregatorFactory
AggregatorFactory.MultiBucketAggregatorWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected ValuesSourceConfig<VS>
config
-
Fields inherited from class org.elasticsearch.search.aggregations.AggregatorFactory
factories, metaData, name, parent, queryShardContext
-
-
Constructor Summary
Constructors Constructor Description ValuesSourceAggregatorFactory(java.lang.String name, ValuesSourceConfig<VS> config, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
Method Summary
Modifier and Type Method Description Aggregator
createInternal(SearchContext searchContext, Aggregator parent, boolean collectsFromSingleBucket, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected abstract Aggregator
createUnmapped(SearchContext searchContext, Aggregator parent, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected abstract Aggregator
doCreateInternal(VS valuesSource, SearchContext searchContext, Aggregator parent, boolean collectsFromSingleBucket, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
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.AggregatorFactory
asMultiBucketAggregator, create, doValidate, getParent, name
-
-
-
-
Field Detail
-
config
protected ValuesSourceConfig<VS extends ValuesSource> config
-
-
Constructor Detail
-
ValuesSourceAggregatorFactory
public ValuesSourceAggregatorFactory(java.lang.String name, ValuesSourceConfig<VS> config, 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
-
createInternal
public Aggregator createInternal(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:
createInternal
in classAggregatorFactory
- Throws:
java.io.IOException
-
resolveMissingAny
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. 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.- Parameters:
missing
- The user supplied missing value- Returns:
- A ValuesSource instance compatible with the supplied parameter
-
createUnmapped
protected abstract 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
- Throws:
java.io.IOException
-
doCreateInternal
protected abstract Aggregator doCreateInternal(VS 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
- Throws:
java.io.IOException
-
-