Module org.elasticsearch.server
Class InternalOrder.CompoundOrder
java.lang.Object
org.elasticsearch.search.aggregations.BucketOrder
org.elasticsearch.search.aggregations.InternalOrder.CompoundOrder
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Enclosing class:
- InternalOrder
MultiBucketsAggregation.Bucket ordering strategy to sort by multiple criteria.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionBuild a comparator for fully built buckets.booleaninthashCode()<T extends MultiBucketsAggregation.Bucket>
Comparator<T>partiallyBuiltBucketComparator(ToLongFunction<T> ordinalReader, Aggregator aggregator) A builds comparator comparing buckets partially built buckets by delegating comparison of the results of any "child" aggregations to the provided Aggregator.toXContent(XContentBuilder builder, ToXContent.Params params) Methods inherited from class org.elasticsearch.search.aggregations.BucketOrder
aggregation, aggregation, compound, compound, count, key, toString, validate, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Method Details
-
orderElements
- Returns:
- unmodifiable list of
BucketOrders to sort on.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
partiallyBuiltBucketComparator
public <T extends MultiBucketsAggregation.Bucket> Comparator<T> partiallyBuiltBucketComparator(ToLongFunction<T> ordinalReader, Aggregator aggregator) Description copied from class:BucketOrderA builds comparator comparing buckets partially built buckets by delegating comparison of the results of any "child" aggregations to the provided Aggregator.Warning: This is fairly difficult to use and impossible to use cleanly. In addition, this exists primarily to return the "top n" buckets based on the results of a sub aggregation. The trouble is that could end up throwing away buckets on the data nodes that should ultimately be kept after reducing all of the results. If you know that this is coming it is fine, but most folks that use "generic" sorts don't. In other words: before you use this method think super duper hard if you want to have these kinds of issues. The terms agg does an folks get into trouble with it all the time.
- Specified by:
partiallyBuiltBucketComparatorin classBucketOrder
-
comparator
Description copied from class:BucketOrderBuild a comparator for fully built buckets.- Specified by:
comparatorin classBucketOrder
-
hashCode
public int hashCode()- Specified by:
hashCodein classBucketOrder
-
equals
- Specified by:
equalsin classBucketOrder
-