public class HistogramAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder> implements MultiBucketAggregationBuilder
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>AggregationBuilder.CommonFieldsWriteable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
configmetaDatafactoriesBuilder, nameEMPTY_PARAMS| Constructor and Description |
|---|
HistogramAggregationBuilder(StreamInput in)
Read from a stream, for internal use only.
|
HistogramAggregationBuilder(java.lang.String name)
Create a new builder with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
protected XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
HistogramAggregationBuilder |
extendedBounds(double minBound,
double maxBound)
Set extended bounds on this builder: buckets between
minBound and
maxBound will be created even if no documents fell into these
buckets. |
java.lang.String |
getType()
The name of the type of aggregation built by this builder.
|
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric,?> |
innerBuild(SearchContext context,
ValuesSourceConfig<ValuesSource.Numeric> config,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) |
protected boolean |
innerEquals(java.lang.Object obj) |
protected int |
innerHashCode() |
protected void |
innerWriteTo(StreamOutput out)
Write subclass's state to the stream.
|
double |
interval()
Get the current interval that is set on this builder.
|
HistogramAggregationBuilder |
interval(double interval)
Set the interval on this builder, and return the builder so that calls can be chained.
|
boolean |
keyed()
Return whether buckets should be returned as a hash.
|
HistogramAggregationBuilder |
keyed(boolean keyed)
Set whether to return buckets as a hash or as an array, and return the
builder so that calls can be chained.
|
double |
maxBound()
Get the current maximum bound that is set on this builder.
|
double |
minBound()
Get the current minimum bound that is set on this builder.
|
long |
minDocCount()
Return the minimum count of documents that buckets need to have in order
to be included in the response.
|
HistogramAggregationBuilder |
minDocCount(long minDocCount)
Set the minimum count of matching documents that buckets need to have
and return this builder so that calls can be chained.
|
double |
offset()
Get the current offset that is set on this builder.
|
HistogramAggregationBuilder |
offset(double offset)
Set the offset on this builder, and return the builder so that calls can be chained.
|
BucketOrder |
order()
Return the order to use to sort buckets of this histogram.
|
HistogramAggregationBuilder |
order(BucketOrder order)
Set a new order on this builder and return the builder so that calls
can be chained.
|
HistogramAggregationBuilder |
order(java.util.List<BucketOrder> orders)
Sets the order in which the buckets will be returned.
|
static HistogramAggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
doBuild, doEquals, doHashCode, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, valueType, valueTypebuild, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTodoRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic static final java.lang.String NAME
public HistogramAggregationBuilder(java.lang.String name)
public HistogramAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static HistogramAggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOExceptionprotected void innerWriteTo(StreamOutput out) throws java.io.IOException
ValuesSourceAggregationBuilderinnerWriteTo in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>java.io.IOExceptionpublic double interval()
public HistogramAggregationBuilder interval(double interval)
public double offset()
public HistogramAggregationBuilder offset(double offset)
public double minBound()
public double maxBound()
public HistogramAggregationBuilder extendedBounds(double minBound, double maxBound)
minBound and
maxBound will be created even if no documents fell into these
buckets.java.lang.IllegalArgumentException - if maxBound is less that minBound, or if either of the bounds
are not finite.public BucketOrder order()
public HistogramAggregationBuilder order(BucketOrder order)
public HistogramAggregationBuilder order(java.util.List<BucketOrder> orders)
public boolean keyed()
keyed is false, buckets will be returned as an array.public HistogramAggregationBuilder keyed(boolean keyed)
public long minDocCount()
public HistogramAggregationBuilder minDocCount(long minDocCount)
protected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContentBody in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>java.io.IOExceptionpublic java.lang.String getType()
BaseAggregationBuildergetType in interface BaseAggregationBuilderprotected ValuesSourceAggregatorFactory<ValuesSource.Numeric,?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.Numeric> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>java.io.IOExceptionprotected int innerHashCode()
innerHashCode in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>protected boolean innerEquals(java.lang.Object obj)
innerEquals in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>