NamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
, BaseAggregationBuilder
public class GeoDistanceAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>
Modifier and Type | Class | Description |
---|---|---|
static class |
GeoDistanceAggregationBuilder.Range |
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
Constructor | Description |
---|---|
GeoDistanceAggregationBuilder(java.lang.String name,
GeoPoint origin) |
|
GeoDistanceAggregationBuilder(StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
GeoDistanceAggregationBuilder |
addRange(double from,
double to) |
Same as
addRange(String, double, double) but the key will be
automatically generated based on from and
to . |
GeoDistanceAggregationBuilder |
addRange(java.lang.String key,
double from,
double to) |
Add a new range to this aggregation.
|
GeoDistanceAggregationBuilder |
addRange(GeoDistanceAggregationBuilder.Range range) |
|
GeoDistanceAggregationBuilder |
addUnboundedFrom(double from) |
Same as
addUnboundedFrom(String, double) but the key will be
computed automatically. |
GeoDistanceAggregationBuilder |
addUnboundedFrom(java.lang.String key,
double from) |
Add a new range with no upper bound.
|
GeoDistanceAggregationBuilder |
addUnboundedTo(double to) |
Same as
addUnboundedTo(String, double) but the key will be
computed automatically. |
GeoDistanceAggregationBuilder |
addUnboundedTo(java.lang.String key,
double to) |
Add a new range with no lower bound.
|
GeoDistance |
distanceType() |
|
GeoDistanceAggregationBuilder |
distanceType(GeoDistance distanceType) |
|
protected XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
|
java.lang.String |
getType() |
The name of the type of aggregation built by this builder.
|
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint,?> |
innerBuild(SearchContext context,
ValuesSourceConfig<ValuesSource.GeoPoint> 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.
|
boolean |
keyed() |
|
GeoDistanceAggregationBuilder |
keyed(boolean keyed) |
|
GeoPoint |
origin() |
Return the
GeoPoint that is used for distance computations. |
static AggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
|
java.util.List<GeoDistanceAggregationBuilder.Range> |
range() |
|
DistanceUnit |
unit() |
|
GeoDistanceAggregationBuilder |
unit(DistanceUnit unit) |
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 GeoDistanceAggregationBuilder(java.lang.String name, GeoPoint origin)
public GeoDistanceAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public static AggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOException
protected void innerWriteTo(StreamOutput out) throws java.io.IOException
ValuesSourceAggregationBuilder
innerWriteTo
in class ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>
java.io.IOException
public GeoDistanceAggregationBuilder addRange(GeoDistanceAggregationBuilder.Range range)
public GeoDistanceAggregationBuilder addRange(java.lang.String key, double from, double to)
key
- the key to use for this range in the responsefrom
- the lower bound on the distances, inclusiveto
- the upper bound on the distances, exclusivepublic GeoDistanceAggregationBuilder addRange(double from, double to)
addRange(String, double, double)
but the key will be
automatically generated based on from
and
to
.public GeoDistanceAggregationBuilder addUnboundedTo(java.lang.String key, double to)
key
- the key to use for this range in the responseto
- the upper bound on the distances, exclusivepublic GeoDistanceAggregationBuilder addUnboundedTo(double to)
addUnboundedTo(String, double)
but the key will be
computed automatically.public GeoDistanceAggregationBuilder addUnboundedFrom(java.lang.String key, double from)
key
- the key to use for this range in the responsefrom
- the lower bound on the distances, inclusivepublic GeoDistanceAggregationBuilder addUnboundedFrom(double from)
addUnboundedFrom(String, double)
but the key will be
computed automatically.public java.util.List<GeoDistanceAggregationBuilder.Range> range()
public java.lang.String getType()
BaseAggregationBuilder
public GeoDistanceAggregationBuilder unit(DistanceUnit unit)
public DistanceUnit unit()
public GeoDistanceAggregationBuilder distanceType(GeoDistance distanceType)
public GeoDistance distanceType()
public GeoDistanceAggregationBuilder keyed(boolean keyed)
public boolean keyed()
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint,?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild
in class ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>
java.io.IOException
protected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContentBody
in class ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>
java.io.IOException
protected int innerHashCode()
innerHashCode
in class ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>
protected boolean innerEquals(java.lang.Object obj)
innerEquals
in class ValuesSourceAggregationBuilder<ValuesSource.GeoPoint,GeoDistanceAggregationBuilder>