public abstract class ValuesSourceAggregationBuilder<B extends ValuesSourceAggregationBuilder<B>> extends AggregationBuilder<B>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
type
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ValuesSourceAggregationBuilder(String name,
String type)
Constructs a new builder.
|
Modifier and Type | Method and Description |
---|---|
protected abstract XContentBuilder |
doInternalXContent(XContentBuilder builder,
ToXContent.Params params) |
B |
field(String field)
Sets the field from which the values will be extracted.
|
protected XContentBuilder |
internalXContent(XContentBuilder builder,
ToXContent.Params builderParams) |
B |
missing(Object missingValue)
Configure the value to use when documents miss a value.
|
B |
script(Script script)
Sets the script which generates the values.
|
setMetaData, subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, toXContent
getName
public B field(String field)
field
- The name of the fieldpublic B script(Script script)
field(String)
), then
this script will be treated as a value script
. A value script will be applied on the values that are extracted from
the field data (you can refer to that value in the script using the _value
reserved variable). If only the script is configured
(and the no field is configured next to it), then the script will be responsible to generate the values that will be aggregated.script
- The configured script.public B missing(Object missingValue)
protected final XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params builderParams) throws IOException
internalXContent
in class AggregationBuilder<B extends ValuesSourceAggregationBuilder<B>>
IOException
protected abstract XContentBuilder doInternalXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
Copyright © 2009–2016. All rights reserved.