Class ScriptedMetricAggregationBuilder
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
org.elasticsearch.search.aggregations.metrics.ScriptedMetricAggregationBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Rewriteable<AggregationBuilder>
,BaseAggregationBuilder
public class ScriptedMetricAggregationBuilder
extends AbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
-
Nested Class Summary
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 TypeFieldDescriptionstatic String
static org.elasticsearch.common.xcontent.ConstructingObjectParser<ScriptedMetricAggregationBuilder,String>
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
ScriptedMetricAggregationBuilder(ScriptedMetricAggregationBuilder 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.Get thecombine
script.combineScript(Script combineScript)
Set thecombine
script.protected org.elasticsearch.search.aggregations.metrics.ScriptedMetricAggregatorFactory
doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder)
protected void
doWriteTo(StreamOutput out)
boolean
getType()
The name of the type of aggregation built by this builder.int
hashCode()
Get theinit
script.initScript(Script initScript)
Set theinit
script.protected org.elasticsearch.common.xcontent.XContentBuilder
internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params builderParams)
Get themap
script.Set themap
script.params()
Get parameters that will be available in theinit
,map
andcombine
phases.Set parameters that will be available in theinit
,map
andcombine
phases.Get thereduce
script.reduceScript(Script reduceScript)
Set thereduce
script.protected AggregationBuilder
shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata)
Create a shallow copy of this builder and replacingAggregationBuilder.factoriesBuilder
andmetadata
.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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
PARSER
public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<ScriptedMetricAggregationBuilder,String> PARSER
-
-
Constructor Details
-
ScriptedMetricAggregationBuilder
-
ScriptedMetricAggregationBuilder
protected ScriptedMetricAggregationBuilder(ScriptedMetricAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
ScriptedMetricAggregationBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
shallowCopy
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata)Description copied from class:AggregationBuilder
Create a shallow copy of this builder and replacingAggregationBuilder.factoriesBuilder
andmetadata
. Used byAggregationBuilder.rewrite(QueryRewriteContext)
.- Specified by:
shallowCopy
in classAggregationBuilder
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
- Throws:
IOException
-
initScript
Set theinit
script. -
initScript
Get theinit
script. -
mapScript
Set themap
script. -
mapScript
Get themap
script. -
combineScript
Set thecombine
script. -
combineScript
Get thecombine
script. -
reduceScript
Set thereduce
script. -
reduceScript
Get thereduce
script. -
params
Set parameters that will be available in theinit
,map
andcombine
phases. -
params
Get parameters that will be available in theinit
,map
andcombine
phases. -
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
-
doBuild
protected org.elasticsearch.search.aggregations.metrics.ScriptedMetricAggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws IOException- Specified by:
doBuild
in classAbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
- Throws:
IOException
-
internalXContent
protected org.elasticsearch.common.xcontent.XContentBuilder internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params builderParams) throws IOException- Specified by:
internalXContent
in classAbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
- Throws:
IOException
-
getType
Description copied from interface:BaseAggregationBuilder
The name of the type of aggregation built by this builder. -
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
-
equals
- Overrides:
equals
in classAbstractAggregationBuilder<ScriptedMetricAggregationBuilder>
-