Class InternalOrder.Aggregation
- java.lang.Object
-
- org.elasticsearch.search.aggregations.BucketOrder
-
- org.elasticsearch.search.aggregations.InternalOrder
-
- org.elasticsearch.search.aggregations.InternalOrder.Aggregation
-
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentObject
- Enclosing class:
- InternalOrder
public static class InternalOrder.Aggregation extends InternalOrder
MultiBucketsAggregation.Bucket
ordering strategy to sort by a sub-aggregation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalOrder
InternalOrder.Aggregation, InternalOrder.CompoundOrder, InternalOrder.Parser, InternalOrder.Streams
-
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 inherited from class org.elasticsearch.search.aggregations.InternalOrder
asc, comparator
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description java.util.Comparator<MultiBucketsAggregation.Bucket>
comparator(Aggregator aggregator)
AggregationPath
path()
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalOrder
equals, hashCode, isCountDesc, isKeyAsc, isKeyDesc, isKeyOrder, toXContent, validate
-
Methods inherited from class org.elasticsearch.search.aggregations.BucketOrder
aggregation, aggregation, compound, compound, count, key, toString, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Method Detail
-
path
public AggregationPath path()
- Returns:
- parsed path to the sub-aggregation to sort on.
-
comparator
public java.util.Comparator<MultiBucketsAggregation.Bucket> comparator(Aggregator aggregator)
- Overrides:
comparator
in classInternalOrder
- Returns:
- A comparator for the bucket based on the given aggregator. The comparator is used in two phases:
- aggregation phase, where each shard builds a list of buckets to be sent to the coordinating node. In this phase, the passed in aggregator will be the aggregator that aggregates the buckets on the shard level.
- reduce phase, where the coordinating node gathers all the buckets from all the shards and reduces them to a final bucket list. In this case, the passed in aggregator will be
null
.
-
-