Package org.elasticsearch.plugins
Class SearchPlugin.AggregationSpec
java.lang.Object
org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<AggregationBuilder,org.elasticsearch.common.xcontent.ContextParser<String,? extends AggregationBuilder>>
org.elasticsearch.plugins.SearchPlugin.AggregationSpec
- Enclosing interface:
- SearchPlugin
public static class SearchPlugin.AggregationSpec
extends SearchPlugin.SearchExtensionSpec<AggregationBuilder,org.elasticsearch.common.xcontent.ContextParser<String,? extends AggregationBuilder>>
Specification for an
Aggregation
.-
Constructor Summary
ConstructorDescriptionAggregationSpec(String name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Deprecated.AggregationSpec(String name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<String,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<String,T> parser)
Specification for anAggregation
. -
Method Summary
Modifier and TypeMethodDescriptionaddResultReader(String writeableName, 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 aggregationMap<String,Writeable.Reader<? extends InternalAggregation>>
Get the readers that must be registered for this aggregation's results.setAggregatorRegistrar(Consumer<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
-
Constructor Details
-
AggregationSpec
public AggregationSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<String,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(String name, Writeable.Reader<T> reader, org.elasticsearch.common.xcontent.ContextParser<String,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
@Deprecated 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
@Deprecated public AggregationSpec(String 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 SearchPlugin.AggregationSpec addResultReader(String 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 SearchPlugin.AggregationSpec setAggregatorRegistrar(Consumer<ValuesSourceRegistry.Builder> aggregatorRegistrar)Set the function to register theValuesSource
to aggregator mappings for this aggregation
-
ContextParser
instead