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
  • Field Details

  • Constructor Details

  • Method Details

    • 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 class AggregatorFactory
      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 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.
      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