Package org.elasticsearch.plugins
Class SearchPlugin.AggregationSpec
,? extends AggregationBuilder>>
org.elasticsearch.plugins.SearchPlugin.AggregationSpec
- Enclosing interface:
- SearchPlugin
Specification for an
Aggregation
.-
Constructor Summary
ConstructorDescriptionname, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Deprecated.name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<,T> parser)
Specification for anAggregation
.AggregationSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Deprecated.Use the ctor that takes aContextParser
insteadAggregationSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<,T> parser)
Specification for anAggregation
. -
Method Summary
Modifier and TypeMethodDescriptionwriteableName, Writeable.Reader<? extends InternalAggregation> resultReader)
Add a reader for the shard level results of the aggregation.addResultReader(Writeable.Reader<? extends InternalAggregation> resultReader)
Add a reader for the shard level results of the aggregation with SearchPlugin.SearchExtensionSpec.getName()'sParseField.getPreferredName()
as theNamedWriteable.getWriteableName()
.Get the function to register theValuesSource
to aggregator mappings for this aggregation<,Writeable.Reader<? extends InternalAggregation>>
Get the readers that must be registered for this aggregation's results.<ValuesSourceRegistry.Builder> aggregatorRegistrar)
Set the function to register theValuesSource
to aggregator mappings for this aggregationMethods inherited from class org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec
getName, getParser, getReader
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
AggregationSpec
public AggregationSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<,T> parser)Specification for anAggregation
.- Parameters:
name
- holds the names by which this aggregation might be parsed. TheParseField.getPreferredName()
is special as it is the name by under which the reader is registered. So it is the name that theAggregationBuilder
should return fromNamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInput
parser
- the parser the reads the aggregation builder from xcontent
-
AggregationSpec
public AggregationSpec( name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<,T> parser)Specification for anAggregation
.- Parameters:
name
- the name by which this aggregation might be parsed or deserialized. Make sure that theAggregationBuilder
returns this fromNamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInput
parser
- the parser the reads the aggregation builder from xcontent
-
AggregationSpec
public AggregationSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)Deprecated.Use the ctor that takes aContextParser
insteadSpecification for anAggregation
.- Parameters:
name
- holds the names by which this aggregation might be parsed. TheParseField.getPreferredName()
is special as it is the name by under which the reader is registered. So it is the name that theAggregationBuilder
should return fromNamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInput
parser
- the parser the reads the aggregation builder from xcontent
-
AggregationSpec
public AggregationSpec( name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)Deprecated.Use the ctor that takes aContextParser
insteadSpecification for anAggregation
.- Parameters:
name
- the name by which this aggregation might be parsed or deserialized. Make sure that theAggregationBuilder
returns this fromNamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInput
parser
- the parser the reads the aggregation builder from xcontent
-
-
Method Details
-
addResultReader
public SearchPlugin.AggregationSpec addResultReader(Writeable.Reader<? extends InternalAggregation> resultReader)Add a reader for the shard level results of the aggregation with SearchPlugin.SearchExtensionSpec.getName()'sParseField.getPreferredName()
as theNamedWriteable.getWriteableName()
. -
addResultReader
public writeableName, Writeable.Reader<? extends InternalAggregation> resultReader)Add a reader for the shard level results of the aggregation. -
getResultReaders
Get the readers that must be registered for this aggregation's results. -
getAggregatorRegistrar
Get the function to register theValuesSource
to aggregator mappings for this aggregation -
setAggregatorRegistrar
public <ValuesSourceRegistry.Builder> aggregatorRegistrar)Set the function to register theValuesSource
to aggregator mappings for this aggregation
-
ContextParser
instead