当字段中的多个值时,如何更改项汇总的默认值大小参数?
根据Elasticsearch 文档,“术语”聚合以最多的文档返回前十个条款。在我的特殊情况下,我要发送14个必需的值。
{
"size": 0,
"aggs": {
"counts": {
"filters": {
"filters": {
"respondents": {
"bool": {
"should": [
{
"terms": {
"my_field": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14"
],
"size": 20 // this is not working
}
}
]
}
}
}
}
}
}
}
但是其中4个没有退还。 如果我与“ my_field”属性并排添加“大小”属性,那么返回错误:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[terms] query does not support [size]",
"line": 40,
"col": 49
}
],
"type": "parsing_exception",
"reason": "[terms] query does not support [size]",
"line": 40,
"col": 49
},
"status": 400
}
我该怎么办才能获得所有14个必需的值?
According to the Elasticsearch documentation, the "terms" aggregation returns the top ten terms with the most documents. In my particular case, I am sending 14 required values to count on.
{
"size": 0,
"aggs": {
"counts": {
"filters": {
"filters": {
"respondents": {
"bool": {
"should": [
{
"terms": {
"my_field": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14"
],
"size": 20 // this is not working
}
}
]
}
}
}
}
}
}
}
But then 4 of them are not returned.
If I add the "size" property side by side with "my_field" property, then an error is returned:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[terms] query does not support [size]",
"line": 40,
"col": 49
}
],
"type": "parsing_exception",
"reason": "[terms] query does not support [size]",
"line": 40,
"col": 49
},
"status": 400
}
What should I do to be able to get all 14 required values?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您缺少
术语
聚合和filter
聚合不支持size> size
param,因为它将在聚合查询上应用过滤器。You are missing
term
aggregation andfilter
aggregation doesn't supportsize
param as it will apply filter on aggregation query.