I am trying to group the results on a particular field by using the following query:
{
"from": 0,
"size": 0,
"fields": [
"exitPage.categoryId"
],
"aggs": {
"check": {
"terms": {
"field": "exitPage.categoryId"
}
}
}
}
Elasticsearch server throws this exception:
{
"error": "ClassCastException[null]",
"status": 500
}
and that too, on an intermittent basis - sometimes it returns results while sometimes it does not. There is no more descriptive information available in the server log.
Does anyone have a clue to this problem?
Edit: Added error log as asked by Val
[2016-02-01 12:42:28,773][DEBUG][action.search.type ] [elastic71] failed to reduce search
org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to execute phase [fetch], [reduce]
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.onFailure(TransportSearchQueryThenFetchAction.java:159)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException