Package org.elasticsearch.plugins
Class SearchPlugin.AggregationSpec
- java.lang.Object
-
- org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<AggregationBuilder,Aggregator.Parser>
-
- org.elasticsearch.plugins.SearchPlugin.AggregationSpec
-
- Enclosing interface:
- SearchPlugin
public static class SearchPlugin.AggregationSpec extends SearchPlugin.SearchExtensionSpec<AggregationBuilder,Aggregator.Parser>
Specification for anAggregation.
-
-
Constructor Summary
Constructors Constructor Description AggregationSpec(java.lang.String name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)Specification for anAggregation.AggregationSpec(ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)Specification for anAggregation.
-
Method Summary
Modifier and Type Method Description SearchPlugin.AggregationSpecaddResultReader(java.lang.String writeableName, Writeable.Reader<? extends InternalAggregation> resultReader)Add a reader for the shard level results of the aggregation.SearchPlugin.AggregationSpecaddResultReader(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().java.util.Map<java.lang.String,Writeable.Reader<? extends InternalAggregation>>getResultReaders()Get the readers that must be registered for this aggregation's results.-
Methods inherited from class org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec
getName, getParser, getReader
-
-
-
-
Constructor Detail
-
AggregationSpec
public AggregationSpec(ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser 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 theAggregationBuildershould return fromNamedWriteable.getWriteableName().reader- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInputparser- the parser the reads the aggregation builder from xcontent
-
AggregationSpec
public AggregationSpec(java.lang.String name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)Specification for anAggregation.- Parameters:
name- the name by which this aggregation might be parsed or deserialized. Make sure that theAggregationBuilderreturns this fromNamedWriteable.getWriteableName().reader- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes aStreamInputparser- the parser the reads the aggregation builder from xcontent
-
-
Method Detail
-
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(java.lang.String writeableName, Writeable.Reader<? extends InternalAggregation> resultReader)
Add a reader for the shard level results of the aggregation.
-
getResultReaders
public java.util.Map<java.lang.String,Writeable.Reader<? extends InternalAggregation>> getResultReaders()
Get the readers that must be registered for this aggregation's results.
-
-