Class GeoGridAggregationBuilder
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Rewriteable<AggregationBuilder>,BaseAggregationBuilder
- Direct Known Subclasses:
GeoHashGridAggregationBuilder,GeoTileGridAggregationBuilder
public abstract class GeoGridAggregationBuilder extends ValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceGeoGridAggregationBuilder.PrecisionParserNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<AB>>Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description protected intprecisionprotected intrequiredSizeprotected intshardSizeFields inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
configFields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadataFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name -
Constructor Summary
Constructors Modifier Constructor Description GeoGridAggregationBuilder(java.lang.String name)GeoGridAggregationBuilder(StreamInput in)Read from a stream.protectedGeoGridAggregationBuilder(GeoGridAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
Method Summary
Modifier and Type Method Description AggregationBuilder.BucketCardinalitybucketCardinality()A rough count of the number of buckets thatAggregators built by this builder will contain per owning parent bucket.protected abstract ValuesSourceAggregatorFactorycreateFactory(java.lang.String name, ValuesSourceConfig config, int precision, int requiredSize, int shardSize, GeoBoundingBox geoBoundingBox, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata)Creates a new instance of theValuesSourceAggregatorFactory-derived class specific to the geo aggregation.static <T extends GeoGridAggregationBuilder>
org.elasticsearch.common.xcontent.ObjectParser<T,java.lang.String>createParser(java.lang.String name, GeoGridAggregationBuilder.PrecisionParser precisionParser, java.util.function.Function<java.lang.String,T> ctor)protected ValuesSourceTypedefaultValueSourceType()Aggregations should use this method to define aValuesSourceTypeof last resort.protected org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleanequals(java.lang.Object obj)GeoBoundingBoxgeoBoundingBox()inthashCode()protected ValuesSourceAggregatorFactoryinnerBuild(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected voidinnerWriteTo(StreamOutput out)Write subclass's state to the stream.intprecision()abstract GeoGridAggregationBuilderprecision(int precision)method to validate and set the precision valueGeoGridAggregationBuildersetGeoBoundingBox(GeoBoundingBox geoBoundingBox)intshardSize()GeoGridAggregationBuildershardSize(int shardSize)intsize()GeoGridAggregationBuildersize(int size)Methods inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
declareFields, declareFields, doBuild, doWriteTo, field, field, format, format, getRegistryKey, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, userValueTypeHint, userValueTypeHintMethods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeToMethods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
-
Field Details
-
precision
protected int precision -
requiredSize
protected int requiredSize -
shardSize
protected int shardSize
-
-
Constructor Details
-
GeoGridAggregationBuilder
public GeoGridAggregationBuilder(java.lang.String name) -
GeoGridAggregationBuilder
protected GeoGridAggregationBuilder(GeoGridAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
GeoGridAggregationBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
createParser
public static <T extends GeoGridAggregationBuilder> org.elasticsearch.common.xcontent.ObjectParser<T,java.lang.String> createParser(java.lang.String name, GeoGridAggregationBuilder.PrecisionParser precisionParser, java.util.function.Function<java.lang.String,T> ctor) -
defaultValueSourceType
Description copied from class:ValuesSourceAggregationBuilderAggregations should use this method to define aValuesSourceTypeof last resort. This will only be used when the resolver can't find a field and the user hasn't provided a value type hint.- Specified by:
defaultValueSourceTypein classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>- Returns:
- The CoreValuesSourceType we expect this script to yield.
-
innerWriteTo
Description copied from class:ValuesSourceAggregationBuilderWrite subclass's state to the stream.- Specified by:
innerWriteToin classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>- Throws:
java.io.IOException
-
precision
method to validate and set the precision value- Parameters:
precision- the precision to set for the aggregation- Returns:
- the
GeoGridAggregationBuilderbuilder
-
createFactory
protected abstract ValuesSourceAggregatorFactory createFactory(java.lang.String name, ValuesSourceConfig config, int precision, int requiredSize, int shardSize, GeoBoundingBox geoBoundingBox, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) throws java.io.IOExceptionCreates a new instance of theValuesSourceAggregatorFactory-derived class specific to the geo aggregation.- Throws:
java.io.IOException
-
precision
public int precision() -
size
-
size
public int size() -
shardSize
-
shardSize
public int shardSize() -
setGeoBoundingBox
-
geoBoundingBox
-
bucketCardinality
Description copied from class:AggregationBuilderA rough count of the number of buckets thatAggregators built by this builder will contain per owning parent bucket.- Specified by:
bucketCardinalityin classAggregationBuilder
-
innerBuild
protected ValuesSourceAggregatorFactory innerBuild(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException- Specified by:
innerBuildin classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>- Throws:
java.io.IOException
-
doXContentBody
protected org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
doXContentBodyin classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
-
hashCode
public int hashCode()- Overrides:
hashCodein classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
-