Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregations: Value Count Agg cannot be used for sort order #7050

Closed
colings86 opened this Issue Jul 28, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@colings86
Copy link
Member

commented Jul 28, 2014

If a value count agg is used for the sort column of a terms aggregation an exception is thrown stating:

ReduceSearchPhaseException[Failed to execute phase [query], [reduce] ]; nested: ElasticsearchIllegalArgumentException[Invalid order path [grades_count]. Missing value key in [grades_count] which refers to a multi-value metric aggregation]; 

Marvel commands to reproduce error: https://gist.github.com/colings86/4dfcb7de6c474ae69c32

Setting order to:

"order": {
    "grades_count": "desc"
}

produces the following error:

{
   "error": "ReduceSearchPhaseException[Failed to execute phase [fetch], [reduce] ]; nested: ClassCastException[org.elasticsearch.search.aggregations.metrics.valuecount.InternalValueCount cannot be cast to org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation$MultiValue]; ",
   "status": 503
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.