public class HistogramAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource.Numeric,HistogramAggregationBuilder>
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>
AggregationBuilder.CommonFields
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
config
metaData
factoriesBuilder, name
EMPTY_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.
|
Histogram.Order |
order()
Return the order to use to sort buckets of this histogram.
|
HistogramAggregationBuilder |
order(Histogram.Order 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,
QueryParseContext context) |
doBuild, doEquals, doHashCode, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, valueType, valueType
build, equals, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
getName
buildAsBytes, buildAsBytes, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final java.lang.String NAME
public HistogramAggregationBuilder(java.lang.String name)
public HistogramAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public static HistogramAggregationBuilder parse(java.lang.String aggregationName, QueryParseContext context) throws java.io.IOException
java.io.IOException
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 Histogram.Order order()
public HistogramAggregationBuilder order(Histogram.Order order)
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
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>