Does Pipeline aggregation have path length limitation?

Hi,

I am using pipeline aggregation for let's say getting the average of my result buckets in the following example:

"aggs": {
    "ag-histo": {
      "date_histogram": {
        "field": "date",
        "interval": "day"
      },
      "aggs": {
        "ag-sum": {
          "sum": {
            "field": "value"
          }
        }
      }
    },
    "buc-avg":{
      "avg_bucket": {
        "buckets_path": "ag-histo>ag-sum"
      }
    }
  }

and it works fine.

But when I add one more aggregation in between ag-histo and ag-sum and make path longer always I get the following error:
"buckets_path must reference either a number value or a single value numeric metric aggregation, got: java.lang.Object[]"

but I provide a single value numeric metric aggregation (sum). Is that the matter of length of path or?

Not working example: (adding a term aggregation between ag-histo and ag-sum):

"aggs": {
"ag-histo": {
"date_histogram": {
"field": "date",
"interval": "day"
},
"aggs": {
"ag-term": {
"terms": {
"field": "type.keyword",
"size": 10
},
"aggs": {
"ag-sum": {
"sum": {
"field": "value"
}
}
}
}
}
},
"buc-avg":{
"avg_bucket": {
"buckets_path": "ag-histo>ag-term>ag-sum"
}
}
}

Thanks in advance

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.