Class HistogramAggregation.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.aggregations.AggregationBase.AbstractBuilder<BuilderT>
co.elastic.clients.elasticsearch._types.aggregations.BucketAggregationBase.AbstractBuilder<HistogramAggregation.Builder>
co.elastic.clients.elasticsearch._types.aggregations.HistogramAggregation.Builder
- All Implemented Interfaces:
WithJson<HistogramAggregation.Builder>
,ObjectBuilder<HistogramAggregation>
- Enclosing class:
- HistogramAggregation
public static class HistogramAggregation.Builder
extends BucketAggregationBase.AbstractBuilder<HistogramAggregation.Builder>
implements ObjectBuilder<HistogramAggregation>
Builder for
HistogramAggregation
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aHistogramAggregation
.extendedBounds
(ExtendedBounds<Double> value) Enables extending the bounds of the histogram beyond the data itself.Enables extending the bounds of the histogram beyond the data itself.The name of the field to aggregate on.API name:format
hardBounds
(ExtendedBounds<Double> value) Limits the range of buckets in the histogram.Limits the range of buckets in the histogram.The interval for the buckets.Iftrue
, returns buckets as a hash instead of an array, keyed by the bucket keys.minDocCount
(Integer value) Only returns buckets that havemin_doc_count
number of documents.The value to apply to documents that do not have a value.By default, the bucket keys start with 0 and then continue in even spaced steps ofinterval
.order
(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) The sort order of the returned buckets.order
(List<NamedValue<SortOrder>> list) The sort order of the returned buckets.API name:script
API name:script
protected HistogramAggregation.Builder
self()
Methods inherited from class co.elastic.clients.elasticsearch._types.aggregations.AggregationBase.AbstractBuilder
meta, meta, name
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
extendedBounds
Enables extending the bounds of the histogram beyond the data itself.API name:
extended_bounds
-
extendedBounds
public final HistogramAggregation.Builder extendedBounds(Function<ExtendedBounds.Builder<Double>, ObjectBuilder<ExtendedBounds<Double>>> fn) Enables extending the bounds of the histogram beyond the data itself.API name:
extended_bounds
-
hardBounds
Limits the range of buckets in the histogram. It is particularly useful in the case of open data ranges that can result in a very large number of buckets.API name:
hard_bounds
-
hardBounds
public final HistogramAggregation.Builder hardBounds(Function<ExtendedBounds.Builder<Double>, ObjectBuilder<ExtendedBounds<Double>>> fn) Limits the range of buckets in the histogram. It is particularly useful in the case of open data ranges that can result in a very large number of buckets.API name:
hard_bounds
-
field
The name of the field to aggregate on.API name:
field
-
interval
The interval for the buckets. Must be a positive decimal.API name:
interval
-
minDocCount
Only returns buckets that havemin_doc_count
number of documents. By default, the response will fill gaps in the histogram with empty buckets.API name:
min_doc_count
-
missing
The value to apply to documents that do not have a value. By default, documents without a value are ignored.API name:
missing
-
offset
By default, the bucket keys start with 0 and then continue in even spaced steps ofinterval
. The bucket boundaries can be shifted by using theoffset
option.API name:
offset
-
order
The sort order of the returned buckets. By default, the returned buckets are sorted by their key ascending.API name:
order
Adds all elements of
list
toorder
. -
order
public final HistogramAggregation.Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) The sort order of the returned buckets. By default, the returned buckets are sorted by their key ascending.API name:
order
Adds one or more values to
order
. -
script
API name:script
-
script
API name:script
-
format
API name:format
-
keyed
Iftrue
, returns buckets as a hash instead of an array, keyed by the bucket keys.API name:
keyed
-
self
- Specified by:
self
in classAggregationBase.AbstractBuilder<HistogramAggregation.Builder>
-
build
Builds aHistogramAggregation
.- Specified by:
build
in interfaceObjectBuilder<HistogramAggregation>
- Throws:
NullPointerException
- if some of the required fields are null.
-