Aggregation with double nested arrays

Hello,
I'm pretty new to the aggregations but I believe this is a bit complicated
I've the following set of data

      "grossWeight" : 6.43,
      "netWeight" : 6.89,
      "previouid" : "",
      "itemData" : [
        {
          "quantity" : 7,
          "itemCode" : "10007020",
          "specs" : [
            {
              "rate" : 14,
              "model" : "V001",
              "Type" : "T1"
            },
            {
              "rate" : 22,
              "model" : "V231",
              "Type" : "T2"
            },

I've already managed to make agg using grossWeight, netWeight together, using visualize or console no problem
what I want to do, is to add to the aggregations the Type that lies within specs which lies within itemData
knowing that there might be more than one field inside itemData and more than one field inside specs

is that doable?

a side question, if I wrote a request using console and wanted to visualized it, is it possible?

thank you

You should be able to use that field like any other; it should be shown as itemData.specs.Type in Viusalize.
You cannot visualize requests from the console as such, but you can use Discover to view your search results.

Thank you for the response, I'm not sure if I'm doing it wrong but it isn't in the fields drop down list to start with
and when I try to enter it manually, it says that it's not there and the update button stays grayed out

there are other arrays on the same level as itemData, and neither of them shows in the field list, unlike other fields like grossWeight, netWeight it's already there

Can you post your mapping? The field for terms aggregation needs to be Keyword, Numeric, ip, boolean, or binary.

Is "Type" mapped as a keyword?

they are both itemData and specs of "type" : "nested"

but Type has the following

"Type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}

Please note that Kibana does not support aggregation on nested objects. Here is our tracking issue for that, which you can follow for updates on this.

I see, Thank you for the help
last question, is there like a way around that? like can I explode the nested objects?

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