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 params) |
B |
lang(String lang)
Sets the language of the script (if one is defined).
|
B |
param(String name,
Object value)
Sets the value of a parameter that is used in the script (if one is configured).
|
B |
params(Map<String,Object> params)
Sets the values of a parameters that are used in the script (if one is configured).
|
B |
script(String script)
Sets the script which generates the values.
|
subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, toXContent
getName
public B field(String field)
field
- The name of the fieldpublic B script(String 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 lang(String lang)
script(String)
.lang
- The language of the script.public B param(String name, Object value)
name
- The name of the parameter.value
- The value of the parameter.public B params(Map<String,Object> params)
params
- The the parameters.protected final XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) 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–2015. All rights reserved.