Class ValuesSourceRegistry.Builder

java.lang.Object
org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.Builder
Enclosing class:
ValuesSourceRegistry

public static class ValuesSourceRegistry.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • register

      public <T> void register(ValuesSourceRegistry.RegistryKey<T> registryKey, ValuesSourceType valuesSourceType, T aggregatorSupplier, boolean registerUsage)
      Register a ValuesSource to Aggregator mapping. This method registers mappings that only apply to a single ValuesSourceType
      Parameters:
      registryKey - The name of the family of aggregations paired with the expected component supplier type for this family of aggregations. Generally, the aggregation builder is expected to define a constant for use as the registryKey
      valuesSourceType - The ValuesSourceType this mapping applies to.
      aggregatorSupplier - An Aggregation-specific specialization of ComponentSupplier which will construct the mapped aggregator
      registerUsage - Flag to indicate if this aggregation values source combo should be added to the usage registry. Aggregations that set this to false should register with the usage registry through some other path.
    • register

      public <T> void register(ValuesSourceRegistry.RegistryKey<T> registryKey, List<ValuesSourceType> valuesSourceTypes, T aggregatorSupplier, boolean registerUsage)
      Register a ValuesSource to Aggregator mapping. This version provides a convenience method for mappings that apply to a known list of ValuesSourceType
      Parameters:
      registryKey - The name of the family of aggregations paired with the expected component supplier type for this family of aggregations. Generally, the aggregation builder is expected to define a constant for use as the registryKey
      valuesSourceTypes - The ValuesSourceTypes this mapping applies to.
      aggregatorSupplier - An Aggregation-specific specialization of ComponentSupplier which will construct the mapped aggregator
      registerUsage - Flag to indicate if this aggregation values source combo should be added to the usage registry. Aggregations that set this to false should register with the usage registry through some other path.
    • registerUsage

      public void registerUsage(String aggregationName, ValuesSourceType valuesSourceType)
    • registerUsage

      public void registerUsage(String aggregationName)
    • build

      public ValuesSourceRegistry build()