Class GeoDistanceAggregation.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<GeoDistanceAggregation.Builder>
co.elastic.clients.elasticsearch._types.aggregations.GeoDistanceAggregation.Builder
- All Implemented Interfaces:
WithJson<GeoDistanceAggregation.Builder>
,ObjectBuilder<GeoDistanceAggregation>
- Enclosing class:
- GeoDistanceAggregation
public static class GeoDistanceAggregation.Builder
extends BucketAggregationBase.AbstractBuilder<GeoDistanceAggregation.Builder>
implements ObjectBuilder<GeoDistanceAggregation>
Builder for
GeoDistanceAggregation
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aGeoDistanceAggregation
.distanceType
(GeoDistanceType value) The distance calculation type.A field of typegeo_point
used to evaluate the distance.origin
(GeoLocation value) The origin used to evaluate the distance.The origin used to evaluate the distance.ranges
(AggregationRange value, AggregationRange... values) An array of ranges used to bucket documents.An array of ranges used to bucket documents.ranges
(List<AggregationRange> list) An array of ranges used to bucket documents.protected GeoDistanceAggregation.Builder
self()
unit
(DistanceUnit value) The distance unit.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
-
distanceType
The distance calculation type.API name:
distance_type
-
field
A field of typegeo_point
used to evaluate the distance.API name:
field
-
origin
The origin used to evaluate the distance.API name:
origin
-
origin
public final GeoDistanceAggregation.Builder origin(Function<GeoLocation.Builder, ObjectBuilder<GeoLocation>> fn) The origin used to evaluate the distance.API name:
origin
-
ranges
An array of ranges used to bucket documents.API name:
ranges
Adds all elements of
list
toranges
. -
ranges
public final GeoDistanceAggregation.Builder ranges(AggregationRange value, AggregationRange... values) An array of ranges used to bucket documents.API name:
ranges
Adds one or more values to
ranges
. -
ranges
public final GeoDistanceAggregation.Builder ranges(Function<AggregationRange.Builder, ObjectBuilder<AggregationRange>> fn) An array of ranges used to bucket documents.API name:
ranges
Adds a value to
ranges
using a builder lambda. -
unit
The distance unit.API name:
unit
-
self
- Specified by:
self
in classAggregationBase.AbstractBuilder<GeoDistanceAggregation.Builder>
-
build
Builds aGeoDistanceAggregation
.- Specified by:
build
in interfaceObjectBuilder<GeoDistanceAggregation>
- Throws:
NullPointerException
- if some of the required fields are null.
-