我看别人的size可以为0,但是我的报错了
{
"query": {
},
"aggs": {
"test": {
"terms": {
"field": "account_id",
"size": 0
}
}
}
}
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[terms] failed to parse field [size]",
"line": 9,
"col": 17
}
],
"type": "parsing_exception",
"reason": "[terms] failed to parse field [size]",
"line": 9,
"col": 17,
"caused_by": {
"type": "illegal_argument_exception",
"reason": "[size] must be greater than 0. Found [0] in [test]"
}
},
"status": 400
}
{
"query": {
},
"aggs": {
"test": {
"terms": {
"field": "account_id",
"size": 0
}
}
}
}
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[terms] failed to parse field [size]",
"line": 9,
"col": 17
}
],
"type": "parsing_exception",
"reason": "[terms] failed to parse field [size]",
"line": 9,
"col": 17,
"caused_by": {
"type": "illegal_argument_exception",
"reason": "[size] must be greater than 0. Found [0] in [test]"
}
},
"status": 400
}
3 个回复
zhihuizhou
赞同来自:
zhihuizhou
赞同来自:
{
"aggregations": {
"agg": {
"terms": {
"field": "supplierId",
"size": 9
},
"aggregations": {
"top": {
"top_hits": {
"size": 1
}
}
}
}
}
}
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: