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
Modifier and TypeClassDescriptionprotected static interface
Nested 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.CommonFields
Nested 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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
Fields inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
config
Fields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadata
Fields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
DEFAULT_PREALLOCATION, factoriesBuilder, name
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionRead from a stream.protected
GeoGridAggregationBuilder(GeoGridAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata)
-
Method Summary
Modifier and TypeMethodDescriptionA rough count of the number of buckets thatAggregator
s built by this builder will contain per owning parent bucket.protected abstract ValuesSourceAggregatorFactory
createFactory(String name, ValuesSourceConfig config, int precision, int requiredSize, int shardSize, GeoBoundingBox geoBoundingBox, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String,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,String>createParser(String name, GeoGridAggregationBuilder.PrecisionParser precisionParser, Function<String,T> ctor)
protected ValuesSourceType
Aggregations should use this method to define aValuesSourceType
of last resort.protected org.elasticsearch.common.xcontent.XContentBuilder
doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
boolean
int
hashCode()
protected ValuesSourceAggregatorFactory
innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)
protected void
innerWriteTo(StreamOutput out)
Write subclass's state to the stream.int
abstract GeoGridAggregationBuilder
precision(int precision)
method to validate and set the precision valuesetGeoBoundingBox(GeoBoundingBox geoBoundingBox)
int
shardSize(int shardSize)
int
size()
size(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, userValueTypeHint
Methods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeTo
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
precision
protected int precision -
requiredSize
protected int requiredSize -
shardSize
protected int shardSize
-
-
Constructor Details
-
GeoGridAggregationBuilder
-
GeoGridAggregationBuilder
protected GeoGridAggregationBuilder(GeoGridAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
GeoGridAggregationBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
createParser
public static <T extends GeoGridAggregationBuilder> org.elasticsearch.common.xcontent.ObjectParser<T,String> createParser(String name, GeoGridAggregationBuilder.PrecisionParser precisionParser, Function<String,T> ctor) -
defaultValueSourceType
Description copied from class:ValuesSourceAggregationBuilder
Aggregations should use this method to define aValuesSourceType
of 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:
defaultValueSourceType
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
- Returns:
- The CoreValuesSourceType we expect this script to yield.
-
innerWriteTo
Description copied from class:ValuesSourceAggregationBuilder
Write subclass's state to the stream.- Specified by:
innerWriteTo
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
- Throws:
IOException
-
precision
method to validate and set the precision value- Parameters:
precision
- the precision to set for the aggregation- Returns:
- the
GeoGridAggregationBuilder
builder
-
createFactory
protected abstract ValuesSourceAggregatorFactory createFactory(String name, ValuesSourceConfig config, int precision, int requiredSize, int shardSize, GeoBoundingBox geoBoundingBox, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String,Object> metadata) throws IOExceptionCreates a new instance of theValuesSourceAggregatorFactory
-derived class specific to the geo aggregation.- Throws:
IOException
-
precision
public int precision() -
size
-
size
public int size() -
shardSize
-
shardSize
public int shardSize() -
setGeoBoundingBox
-
geoBoundingBox
-
bucketCardinality
Description copied from class:AggregationBuilder
A rough count of the number of buckets thatAggregator
s built by this builder will contain per owning parent bucket.- Specified by:
bucketCardinality
in classAggregationBuilder
-
innerBuild
protected ValuesSourceAggregatorFactory innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException- Specified by:
innerBuild
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
- Throws:
IOException
-
doXContentBody
protected org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContentBody
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
- Throws:
IOException
-
equals
- Overrides:
equals
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classValuesSourceAggregationBuilder<GeoGridAggregationBuilder>
-