public class GeoDistanceAggregatorBuilder extends ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
ValuesSourceAggregatorBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregatorBuilder<VS,AB>>
Writeable.Reader<R>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
config
factoriesBuilder, metaData, name, type
EMPTY_PARAMS
Constructor and Description |
---|
GeoDistanceAggregatorBuilder(java.lang.String name,
GeoPoint origin) |
config, doBuild, doEquals, doHashCode, doReadFrom, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, timeZone, timeZone, valueType, valueType
build, equals, getType, hashCode, readFrom, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
buildAsBytes, buildAsBytes, toString
public GeoDistanceAggregatorBuilder(java.lang.String name, GeoPoint origin)
public GeoDistanceAggregatorBuilder addRange(GeoDistanceParser.Range range)
public GeoDistanceAggregatorBuilder 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 GeoDistanceAggregatorBuilder addRange(double from, double to)
addRange(String, double, double)
but the key will be
automatically generated based on from
and
to
.public GeoDistanceAggregatorBuilder 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 GeoDistanceAggregatorBuilder addUnboundedTo(double to)
addUnboundedTo(String, double)
but the key will be
computed automatically.public GeoDistanceAggregatorBuilder 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 GeoDistanceAggregatorBuilder addUnboundedFrom(double from)
addUnboundedFrom(String, double)
but the key will be
computed automatically.public java.util.List<GeoDistanceParser.Range> range()
public java.lang.String getWriteableName()
NamedWriteable
getWriteableName
in interface NamedWriteable<GeoDistanceAggregatorBuilder>
getWriteableName
in class AggregatorBuilder<GeoDistanceAggregatorBuilder>
public GeoDistanceAggregatorBuilder unit(DistanceUnit unit)
public DistanceUnit unit()
public GeoDistanceAggregatorBuilder distanceType(GeoDistance distanceType)
public GeoDistance distanceType()
public GeoDistanceAggregatorBuilder keyed(boolean keyed)
public boolean keyed()
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint,?> innerBuild(AggregationContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
java.io.IOException
protected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContentBody
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
java.io.IOException
protected GeoDistanceAggregatorBuilder innerReadFrom(java.lang.String name, ValuesSourceType valuesSourceType, ValueType targetValueType, StreamInput in) throws java.io.IOException
innerReadFrom
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
java.io.IOException
protected void innerWriteTo(StreamOutput out) throws java.io.IOException
innerWriteTo
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
java.io.IOException
protected int innerHashCode()
innerHashCode
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>
protected boolean innerEquals(java.lang.Object obj)
innerEquals
in class ValuesSourceAggregatorBuilder<ValuesSource.GeoPoint,GeoDistanceAggregatorBuilder>