public abstract class AbstractValuesSourceParser<VS extends ValuesSource> extends java.lang.Object implements Aggregator.Parser
Modifier and Type | Class and Description |
---|---|
static class |
AbstractValuesSourceParser.AnyValuesSourceParser |
static class |
AbstractValuesSourceParser.BytesValuesSourceParser |
static class |
AbstractValuesSourceParser.GeoPointValuesSourceParser |
static class |
AbstractValuesSourceParser.NumericValuesSourceParser |
Modifier and Type | Method and Description |
---|---|
protected abstract ValuesSourceAggregatorBuilder<VS,?> |
createFactory(java.lang.String aggregationName,
ValuesSourceType valuesSourceType,
ValueType targetValueType,
java.util.Map<ParseField,java.lang.Object> otherOptions)
Creates a
ValuesSourceAggregatorBuilder from the information
gathered by the subclass. |
ValuesSourceAggregatorBuilder<VS,?> |
parse(java.lang.String aggregationName,
XContentParser parser,
QueryParseContext context)
Returns the aggregator factory with which this parser is associated, may return
null indicating the
aggregation should be skipped (e.g. |
protected abstract boolean |
token(java.lang.String aggregationName,
java.lang.String currentFieldName,
XContentParser.Token token,
XContentParser parser,
ParseFieldMatcher parseFieldMatcher,
java.util.Map<ParseField,java.lang.Object> otherOptions)
Allows subclasses of
AbstractValuesSourceParser to parse extra
parameters and store them in a Map which will later be passed to
createFactory(String, ValuesSourceType, ValueType, Map) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFactoryPrototypes, type
public final ValuesSourceAggregatorBuilder<VS,?> parse(java.lang.String aggregationName, XContentParser parser, QueryParseContext context) throws java.io.IOException
Aggregator.Parser
null
indicating the
aggregation should be skipped (e.g. when trying to aggregate on unmapped fields).parse
in interface Aggregator.Parser
aggregationName
- The name of the aggregationparser
- The xcontent parsercontext
- The search contextnull
in case the aggregation should be skippedjava.io.IOException
- When parsing failsprotected abstract ValuesSourceAggregatorBuilder<VS,?> createFactory(java.lang.String aggregationName, ValuesSourceType valuesSourceType, ValueType targetValueType, java.util.Map<ParseField,java.lang.Object> otherOptions)
ValuesSourceAggregatorBuilder
from the information
gathered by the subclass. Options parsed in
AbstractValuesSourceParser
itself will be added to the factory
after it has been returned by this method.aggregationName
- the name of the aggregationvaluesSourceType
- the type of the ValuesSource
targetValueType
- the target type of the final value output by the aggregationotherOptions
- a Map
containing the extra options parsed by the
token(String, String, org.elasticsearch.common.xcontent.XContentParser.Token,
XContentParser, ParseFieldMatcher, Map)
methodprotected abstract boolean token(java.lang.String aggregationName, java.lang.String currentFieldName, XContentParser.Token token, XContentParser parser, ParseFieldMatcher parseFieldMatcher, java.util.Map<ParseField,java.lang.Object> otherOptions) throws java.io.IOException
AbstractValuesSourceParser
to parse extra
parameters and store them in a Map
which will later be passed to
createFactory(String, ValuesSourceType, ValueType, Map)
.aggregationName
- the name of the aggregationcurrentFieldName
- the name of the current field being parsedtoken
- the current token for the parserparser
- the parserparseFieldMatcher
- the ParseFieldMatcher
to use to match field namesotherOptions
- 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)
methodtrue
if the current token was correctly parsed,
false
otherwisejava.io.IOException
- if an error occurs whilst parsing