public static class SearchPlugin.AggregationSpec extends SearchPlugin.SearchExtensionSpec<AggregationBuilder,Aggregator.Parser>
Aggregation
.Constructor and Description |
---|
AggregationSpec(ParseField name,
Writeable.Reader<? extends AggregationBuilder> reader,
Aggregator.Parser parser)
Specification for an
Aggregation . |
AggregationSpec(java.lang.String name,
Writeable.Reader<? extends AggregationBuilder> reader,
Aggregator.Parser parser)
Specification for an
Aggregation . |
Modifier and Type | Method and 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()'s
ParseField.getPreferredName() as
the NamedWriteable.getWriteableName() . |
java.util.Map<java.lang.String,Writeable.Reader<? extends InternalAggregation>> |
getResultReaders()
Get the readers that must be registered for this aggregation's results.
|
getName, getParser, getReader
public AggregationSpec(ParseField name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Aggregation
.name
- holds the names by which this aggregation might be parsed. The ParseField.getPreferredName()
is special as it
is the name by under which the reader is registered. So it is the name that the AggregationBuilder
should return
from NamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the aggregation builder from xcontentpublic AggregationSpec(java.lang.String name, Writeable.Reader<? extends AggregationBuilder> reader, Aggregator.Parser parser)
Aggregation
.name
- the name by which this aggregation might be parsed or deserialized. Make sure that the AggregationBuilder
returns this from NamedWriteable.getWriteableName()
.reader
- the reader registered for this aggregation's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the aggregation builder from xcontentpublic SearchPlugin.AggregationSpec addResultReader(Writeable.Reader<? extends InternalAggregation> resultReader)
ParseField.getPreferredName()
as
the NamedWriteable.getWriteableName()
.public SearchPlugin.AggregationSpec addResultReader(java.lang.String writeableName, Writeable.Reader<? extends InternalAggregation> resultReader)
public java.util.Map<java.lang.String,Writeable.Reader<? extends InternalAggregation>> getResultReaders()