Class ArrayValuesSourceParser<VS extends org.elasticsearch.search.aggregations.support.ValuesSource>

java.lang.Object
org.elasticsearch.search.aggregations.matrix.ArrayValuesSourceParser<VS>
All Implemented Interfaces:
org.elasticsearch.search.aggregations.Aggregator.Parser
Direct Known Subclasses:
ArrayValuesSourceParser.BytesValuesSourceParser, ArrayValuesSourceParser.GeoPointValuesSourceParser, ArrayValuesSourceParser.NumericValuesSourceParser

public abstract class ArrayValuesSourceParser<VS extends org.elasticsearch.search.aggregations.support.ValuesSource> extends Object implements org.elasticsearch.search.aggregations.Aggregator.Parser
  • Method Details

    • parse

      public final ArrayValuesSourceAggregationBuilder<?> parse(String aggregationName, org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Specified by:
      parse in interface org.elasticsearch.search.aggregations.Aggregator.Parser
      Throws:
      IOException
    • createFactory

      protected abstract ArrayValuesSourceAggregationBuilder<?> createFactory(String aggregationName, org.elasticsearch.search.aggregations.support.ValuesSourceType valuesSourceType, org.elasticsearch.search.aggregations.support.ValueType targetValueType, Map<org.elasticsearch.xcontent.ParseField,Object> otherOptions)
      Creates a ValuesSourceAggregationBuilder from the information gathered by the subclass. Options parsed in ArrayValuesSourceParser itself will be added to the factory after it has been returned by this method.
      Parameters:
      aggregationName - the name of the aggregation
      valuesSourceType - the type of the ValuesSource
      targetValueType - the target type of the final value output by the aggregation
      otherOptions - a Map containing the extra options parsed by the token(String, String, XContentParser.Token, XContentParser, Map) method
      Returns:
      the created factory
    • token

      protected abstract boolean token(String aggregationName, String currentFieldName, org.elasticsearch.xcontent.XContentParser.Token token, org.elasticsearch.xcontent.XContentParser parser, Map<org.elasticsearch.xcontent.ParseField,Object> otherOptions) throws IOException
      Allows subclasses of ArrayValuesSourceParser to parse extra parameters and store them in a Map which will later be passed to createFactory(String, ValuesSourceType, ValueType, Map).
      Parameters:
      aggregationName - the name of the aggregation
      currentFieldName - the name of the current field being parsed
      token - the current token for the parser
      parser - the parser
      otherOptions - a Map of options to be populated by successive calls to this method which will then be passed to the createFactory(String, ValuesSourceType, ValueType, Map) method
      Returns:
      true if the current token was correctly parsed, false otherwise
      Throws:
      IOException - if an error occurs whilst parsing