I'd like to order the results of a Significant Terms aggregation by descending count.
It is possible to specify: "order": { "_count" : "desc" } for a Terms aggregation but the key "order" is not recognized for a Significant Terms aggregation.
The Significant Terms aggregation does not currently have the ability to define order, the buckets are returned in order of descending significance score. If you would like to see this feature I would suggest raising an issue on the issue list of the Elasticearch Github repository or if you fancy having a go at implementing the feature yourself and contributing it back to the project, raise a Pull Request with your code changes.
thanks for your response ! It confirms what I expected.
Do you think there is a workaround ? Something like having a ES query with two nested levels: first the Significant Terms aggregation and then the ordering ?
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.