NamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
, BaseAggregationBuilder
, MultiBucketAggregationBuilder
public class HistogramAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder> implements MultiBucketAggregationBuilder
AggregationBuilder.CommonFields
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
NAME |
metaData
factoriesBuilder, name
EMPTY_PARAMS
config
Modifier | Constructor | Description |
---|---|---|
|
HistogramAggregationBuilder(java.lang.String name) |
Create a new builder with the given name.
|
|
HistogramAggregationBuilder(StreamInput in) |
Read from a stream, for internal use only.
|
protected |
HistogramAggregationBuilder(HistogramAggregationBuilder clone,
AggregatorFactories.Builder factoriesBuilder,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Modifier and Type | Method | 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(java.util.List<BucketOrder> orders) |
Sets the order in which the buckets will be returned.
|
HistogramAggregationBuilder |
order(BucketOrder order) |
Set a new order on this builder and return the builder so that calls
can be chained.
|
static HistogramAggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
|
protected AggregationBuilder |
shallowCopy(AggregatorFactories.Builder factoriesBuilder,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Create a shallow copy of this builder and replacing
AggregationBuilder.factoriesBuilder and metaData . |
build, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
doBuild, doEquals, doHashCode, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, valueType, valueType
public static final java.lang.String NAME
public HistogramAggregationBuilder(java.lang.String name)
protected HistogramAggregationBuilder(HistogramAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
public HistogramAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public static HistogramAggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOException
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
AggregationBuilder
AggregationBuilder.factoriesBuilder
and metaData
.
Used by AggregationBuilder.rewrite(QueryRewriteContext)
.shallowCopy
in class AggregationBuilder
protected void innerWriteTo(StreamOutput out) throws java.io.IOException
ValuesSourceAggregationBuilder
innerWriteTo
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>
java.io.IOException
public 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.IOException
public java.lang.String getType()
BaseAggregationBuilder
getType
in interface BaseAggregationBuilder
protected 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.IOException
protected int innerHashCode()
innerHashCode
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>
protected boolean innerEquals(java.lang.Object obj)
innerEquals
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>