I have the following query on ES 5.6 :
{
"size": 0,
"query": {
"exists": {
"field": "description.keyword"
}
},
"aggs": {
"group_by_source": {
"terms": {
"field": "flux.source.idname.keyword",
"size": 1000
},
"aggs": {
"description_avg": {
"avg": {
"script": {
"lang": "painless",
"source": "doc['description.keyword'].toString().length()"
}
}
}
}
}
}
}
Which works for what I'm trying to do (display description length avg by source) but I can only see 6 buckets as a result :
Any idea why ?
Thanks in advance, Julien