public abstract class BucketOrder extends java.lang.Object implements ToXContentObject, Writeable
MultiBucketsAggregation.Bucket
Ordering strategy.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Constructor and Description |
---|
BucketOrder() |
Modifier and Type | Method and Description |
---|---|
static BucketOrder |
aggregation(java.lang.String path,
boolean asc)
Creates a bucket ordering strategy which sorts buckets based on a single-valued sub-aggregation.
|
static BucketOrder |
aggregation(java.lang.String path,
java.lang.String metricName,
boolean asc)
Creates a bucket ordering strategy which sorts buckets based on a metric from a multi-valued sub-aggregation.
|
abstract java.util.Comparator<MultiBucketsAggregation.Bucket> |
comparator(Aggregator aggregator) |
static BucketOrder |
compound(BucketOrder... orders)
Creates a bucket ordering strategy which sorts buckets based on multiple criteria.
|
static BucketOrder |
compound(java.util.List<BucketOrder> orders)
Creates a bucket ordering strategy which sorts buckets based on multiple criteria.
|
static BucketOrder |
count(boolean asc)
Creates a bucket ordering strategy that sorts buckets by their document counts (ascending or descending).
|
abstract boolean |
equals(java.lang.Object obj) |
abstract int |
hashCode() |
static BucketOrder |
key(boolean asc)
Creates a bucket ordering strategy that sorts buckets by their keys (ascending or descending).
|
java.lang.String |
toString() |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
toXContent
public static BucketOrder count(boolean asc)
asc
- direction to sort by: true
for ascending, false
for descending.public static BucketOrder key(boolean asc)
asc
- direction to sort by: true
for ascending, false
for descending.public static BucketOrder aggregation(java.lang.String path, boolean asc)
path
- path to the sub-aggregation to sort on.asc
- direction to sort by: true
for ascending, false
for descending.AggregationPath
public static BucketOrder aggregation(java.lang.String path, java.lang.String metricName, boolean asc)
path
- path to the sub-aggregation to sort on.metricName
- name of the value of the multi-value metric to sort on.asc
- direction to sort by: true
for ascending, false
for descending.AggregationPath
public static BucketOrder compound(java.util.List<BucketOrder> orders)
orders
- a list of BucketOrder
objects to sort on, in order of priority.public static BucketOrder compound(BucketOrder... orders)
orders
- a list of BucketOrder
parameters to sort on, in order of priority.public abstract java.util.Comparator<MultiBucketsAggregation.Bucket> comparator(Aggregator aggregator)
- 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
.
public abstract int hashCode()
hashCode
in class java.lang.Object
public abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public java.lang.String toString()
toString
in class java.lang.Object