elasticSearch 查询之Aggs查询

以前用的是es1.6,现在打算升级到6.0,有一些api和语法都变了,求助这段查询怎么改6.0才能用?

{
  "aggs": {
    "filterName0": {
      "filter": {
        "and": [
          {
            "matchAll": {}
          }
        ]
      },
      "aggs": {
        "outerGroup0": {
          "nested": {
            "path": "consuming_behavior"
          },
          "aggs": {
            "outerGroup0o": {
              "terms": {
                "field": "consuming_behavior.second_level_type",
                "include": "ZDY00011"
              },
              "aggs": {
                "innerGroup0": {
                  "nested": {
                    "path": "consuming_behavior.health_record"
                  },
                  "aggs": {
                    "innerGroup0i": {
                      "terms": {
                        "field": "consuming_behavior.health_record.value",
                        "order": {
                          "_count": "desc"
                        },
                        "size": 2147483647
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

在1.6中能够使用,但是在 6.0中报错

"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[and] query malformed, no start_object after query name",
"line": 1,
"col": 41
}
],
"type": "parsing_exception",
"reason": "[and] query malformed, no start_object after query name",
"line": 1,
"col": 41
},
"status": 400
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!