Package org.elasticsearch.plugins
Class SearchPlugin.AggregationSpec
java.lang.Object
org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<AggregationBuilder,ContextParser<java.lang.String,? extends AggregationBuilder>>
org.elasticsearch.plugins.SearchPlugin.AggregationSpec
- Enclosing interface:
- SearchPlugin
public static class SearchPlugin.AggregationSpec extends SearchPlugin.SearchExtensionSpec<AggregationBuilder,ContextParser<java.lang.String,? extends AggregationBuilder>>
Specification for an
Aggregation
.-
Constructor Summary
Constructors Constructor Description AggregationSpec(java.lang.String name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Deprecated.Use the ctor that takes aContextParser
insteadAggregationSpec(java.lang.String name, Writeable.Reader<T> reader, ContextParser<java.lang.String,T> parser)
Specification for anAggregation
.AggregationSpec(ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Deprecated.Use the ctor that takes aContextParser
insteadAggregationSpec(ParseField name, Writeable.Reader<T> reader, ContextParser<java.lang.String,T> parser)
Specification for anAggregation
. -
Method Summary
Modifier and Type Method Description SearchPlugin.AggregationSpec
addResultReader(java.lang.String writeableName, Writeable.Reader<? extends InternalAggregation> resultReader)
Add a reader for the shard level results of the aggregation.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()
.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 Details
-
AggregationSpec
public AggregationSpec(ParseField name, Writeable.Reader<T> reader, ContextParser<java.lang.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(java.lang.String name, Writeable.Reader<T> reader, ContextParser<java.lang.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(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(java.lang.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(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.
-