Elasticsearch 5.6 聚合平均按条款不是所有的桶返回
Elasticsearch 5.6 aggregation avg by terms not all buckets returned
我在 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()"
}
}
}
}
}
}
}
这适用于我正在尝试做的事情(按来源显示描述长度平均值)但结果我只能看到 6 个桶:
知道为什么吗?
提前致谢,
朱利安
{ "size": 0, "query": {
"exists": {
"field": "description.keyword"
} }, "aggs": {
"group_by_source": {
"terms": {
"field": "flux.source.name.keyword",
"size": 1000
},
"aggs": {
"description_avg": {
"avg": {
"script": {
"lang": "painless",
"source": "doc['description.keyword'].toString().length()"
}
}
}
}
} } }
我在 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()"
}
}
}
}
}
}
}
这适用于我正在尝试做的事情(按来源显示描述长度平均值)但结果我只能看到 6 个桶:
知道为什么吗?
提前致谢, 朱利安
{ "size": 0, "query": { "exists": { "field": "description.keyword" } }, "aggs": { "group_by_source": { "terms": { "field": "flux.source.name.keyword", "size": 1000 }, "aggs": { "description_avg": { "avg": { "script": { "lang": "painless", "source": "doc['description.keyword'].toString().length()" } } } } } } }