Class BucketSortPipelineAggregationBuilder
- java.lang.Object
-
- org.elasticsearch.search.aggregations.PipelineAggregationBuilder
-
- org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
-
- org.elasticsearch.search.aggregations.pipeline.bucketsort.BucketSortPipelineAggregationBuilder
-
- All Implemented Interfaces:
NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
,BaseAggregationBuilder
public class BucketSortPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
Builds a pipeline aggregation that allows sorting the buckets of its parent aggregation. The bucket_key
,_count
or sub-aggregations may be used as sort keys. Parametersfrom
andsize
may also be set in order to truncate the result bucket list.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested 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 static java.lang.String
NAME
static ConstructingObjectParser<BucketSortPipelineAggregationBuilder,java.lang.String>
PARSER
-
Fields inherited from class org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder
BUCKETS_PATH_FIELD, metaData, type
-
Fields inherited from class org.elasticsearch.search.aggregations.PipelineAggregationBuilder
bucketsPaths, name
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description BucketSortPipelineAggregationBuilder(java.lang.String name, java.util.List<FieldSortBuilder> sorts)
BucketSortPipelineAggregationBuilder(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description protected PipelineAggregator
createInternal(java.util.Map<java.lang.String,java.lang.Object> metaData)
protected boolean
doEquals(java.lang.Object obj)
protected int
doHashCode()
void
doValidate(AggregatorFactory<?> parent, java.util.Collection<AggregationBuilder> aggFactories, java.util.Collection<PipelineAggregationBuilder> pipelineAggregatoractories)
protected void
doWriteTo(StreamOutput out)
BucketSortPipelineAggregationBuilder
from(int from)
BucketSortPipelineAggregationBuilder
gapPolicy(BucketHelpers.GapPolicy gapPolicy)
java.lang.String
getWriteableName()
Returns the name of the writeable objectprotected XContentBuilder
internalXContent(XContentBuilder builder, ToXContent.Params params)
protected boolean
overrideBucketsPath()
static BucketSortPipelineAggregationBuilder
parse(java.lang.String reducerName, XContentParser parser)
BucketSortPipelineAggregationBuilder
size(java.lang.Integer size)
-
Methods inherited from class org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder
create, equals, getType, hashCode, setMetaData, toXContent, type, validate, validateSequentiallyOrderedParentAggs, writeTo
-
Methods inherited from class org.elasticsearch.search.aggregations.PipelineAggregationBuilder
getBucketsPaths, getName, subAggregations, 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 Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
PARSER
public static final ConstructingObjectParser<BucketSortPipelineAggregationBuilder,java.lang.String> PARSER
-
-
Constructor Detail
-
BucketSortPipelineAggregationBuilder
public BucketSortPipelineAggregationBuilder(java.lang.String name, java.util.List<FieldSortBuilder> sorts)
-
BucketSortPipelineAggregationBuilder
public BucketSortPipelineAggregationBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
protected void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
from
public BucketSortPipelineAggregationBuilder from(int from)
-
size
public BucketSortPipelineAggregationBuilder size(java.lang.Integer size)
-
gapPolicy
public BucketSortPipelineAggregationBuilder gapPolicy(BucketHelpers.GapPolicy gapPolicy)
-
createInternal
protected PipelineAggregator createInternal(java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
- Specified by:
createInternal
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
doValidate
public void doValidate(AggregatorFactory<?> parent, java.util.Collection<AggregationBuilder> aggFactories, java.util.Collection<PipelineAggregationBuilder> pipelineAggregatoractories)
- Overrides:
doValidate
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
-
internalXContent
protected XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
internalXContent
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
parse
public static BucketSortPipelineAggregationBuilder parse(java.lang.String reducerName, XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
overrideBucketsPath
protected boolean overrideBucketsPath()
- Overrides:
overrideBucketsPath
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
- Returns:
true
if theAbstractPipelineAggregationBuilder
overrides the XContent rendering of the bucketPath option.
-
doHashCode
protected int doHashCode()
- Specified by:
doHashCode
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
-
doEquals
protected boolean doEquals(java.lang.Object obj)
- Specified by:
doEquals
in classAbstractPipelineAggregationBuilder<BucketSortPipelineAggregationBuilder>
-
getWriteableName
public java.lang.String getWriteableName()
Description copied from interface:NamedWriteable
Returns the name of the writeable object
-
-