The above example will return an aggregation where the buckets are sorted
based on the average of some other field of the bucketized documents.
Pretty easy. What I would actually want is to do some more complex math
such as the average of the bucketized documents times the number of
documents in the bucket.
The metric aggregation script, as far as I can tell, does not have access
to information of the bucket it is in.
Very pseudo code example above. My hope is that perhaps I missed the fact
that Elasticsearch does support one of these two scenarios. If not, are
there any workarounds to fine-tune sort order? Secondary sorting would also
help.
The above example will return an aggregation where the buckets are sorted
based on the average of some other field of the bucketized documents.
Pretty easy. What I would actually want is to do some more complex math
such as the average of the bucketized documents times the number of
documents in the bucket.
The metric aggregation script, as far as I can tell, does not have access
to information of the bucket it is in.
Very pseudo code example above. My hope is that perhaps I missed the fact
that Elasticsearch does support one of these two scenarios. If not, are
there any workarounds to fine-tune sort order? Secondary sorting would also
help.
Thanks Adrien. What about secondary sorting? The issue talks more
about collation,
so I am not sure if it is more an umbrella issue for all aggregation
sorting concepts. Should I open an issue, comment on the existing one, or
just leave you be?
The above example will return an aggregation where the buckets are sorted
based on the average of some other field of the bucketized documents.
Pretty easy. What I would actually want is to do some more complex math
such as the average of the bucketized documents times the number of
documents in the bucket.
The metric aggregation script, as far as I can tell, does not have access
to information of the bucket it is in.
Very pseudo code example above. My hope is that perhaps I missed the fact
that Elasticsearch does support one of these two scenarios. If not, are
there any workarounds to fine-tune sort order? Secondary sorting would also
help.
Unicode collations know the concept of secondary sorting and much more, see
Jörg
On Tue, Jul 29, 2014 at 11:43 PM, Ivan Brusic ivan@brusic.com wrote:
Thanks Adrien. What about secondary sorting? The issue talks more about collation,
so I am not sure if it is more an umbrella issue for all aggregation
sorting concepts. Should I open an issue, comment on the existing one, or
just leave you be?
The above example will return an aggregation where the buckets are
sorted based on the average of some other field of the bucketized
documents. Pretty easy. What I would actually want is to do some more
complex math such as the average of the bucketized documents times the
number of documents in the bucket.
The metric aggregation script, as far as I can tell, does not have
access to information of the bucket it is in.
Very pseudo code example above. My hope is that perhaps I missed the
fact that Elasticsearch does support one of these two scenarios. If not,
are there any workarounds to fine-tune sort order? Secondary sorting would
also help.
Hi, is there any update on support this requirement? We also need to deal with this kind of sorting based on arithmetical expression result of multiple metrics. Thanks!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.