Which grouping will be affected on Average in Elastic?

11 Views Asked by At

I'm new in Elastic and just want to make sure if my thoughts where right.. In my Query i have added two groupings "field": "statement.actor","field": "statement.type" does the

avg:{"field": "statement.scaled}    

refer to

"field": "statement.actor"

or to

"field": "statement.type"

QUERY:

{
  "aggs": {
    "5": {
      "terms": {
        "field": "statement.type",
        "size": 10,
        "order": {
          "_term": "desc"
        },
        "min_doc_count": 1
      },
      "aggs": {
        "3": {
          "terms": {
            "field": "statement.actor",
            "size": 10,
            "order": {
              "_term": "desc"
            },
            "min_doc_count": 1
          },
          "aggs": {
            "1": {
              "avg": {
                "field": "statement.scaled"
              }
            }
          }
        }
      }
    }
  }
}
0

There are 0 best solutions below