title: Kibana query on NESTED object returns estimated price why?
body: <p>In Kibana visualization I built a bar chart graph that aggregates orders per label bucket (e.g: USD/CAD). Then I display the sum of orders price per bucket for each of the orders inside it.</p>
  
  <p>My chart visualization returns a wrong price which seems to be coming approximated</p>
  
  <p><a href="https://i.stack.imgur.com/6WtK8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6WtK8.png" alt="enter image description here"></a></p>
  
  <p>This is my graph query request debug</p>
  
  <pre><code>{
    "size": 0,
    "_source": {
      "excludes": []
    },
    "aggs": {
      "3": {
        "terms": {
          "field": "label.keyword",
          "size": 2,
          "order": {
            "_term": "desc"
          }
        },
        "aggs": {
          "2": {
            "terms": {
              "field": "orders.id",
              "size": 40,
              "order": {
                "1": "desc"
              }
            },
            "aggs": {
              "1": {
                "sum": {
                  "field": "orders.price"
                }
              }
            }
          }
        }
      }
    },
    "stored_fields": [
      "*"
    ],
    "script_fields": {},
    "docvalue_fields": [],
    "query": {
      "bool": {
        "must": [
          {
            "match_all": {}
          }
        ],
        "filter": [],
        "should": [],
        "must_not": []
      }
    }
  }
  </code></pre>
  
  <p>And this is the response, which confirms the the <code>orders.price</code> value is being approximated</p>
  
  <pre><code>{
    "took": 9,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "total": 124,
      "max_score": 0,
      "hits": []
    },
    "aggregations": {
      "3": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 122,
        "buckets": [
          {
            "2": {
              "doc_count_error_upper_bound": 0,
              "sum_other_doc_count": 0,
              "buckets": [
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213481,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213482,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213483,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213484,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213485,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213486,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213487,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213488,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213489,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213490,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213491,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213492,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213493,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213494,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213495,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213496,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213497,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213498,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213499,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213500,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213501,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213502,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213503,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213504,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213505,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213506,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213507,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213508,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213509,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213510,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213511,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213512,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213513,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213514,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213515,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213516,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213517,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213518,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213519,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.003690590019687079
                  },
                  "key": 213520,
                  "doc_count": 1
                }
              ]
            },
            "key": "IOST/ETH",
            "doc_count": 1
          },
          {
            "2": {
              "doc_count_error_upper_bound": 0,
              "sum_other_doc_count": 0,
              "buckets": [
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213321,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213322,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213323,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213324,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213325,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213326,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213327,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213328,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213329,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213330,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213331,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213332,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213333,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213334,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213335,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213336,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213337,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213338,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213339,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213340,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213341,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213342,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213343,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213344,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213345,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213346,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213347,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213348,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213349,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213350,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213351,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213352,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213353,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213354,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213355,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213356,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213357,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213358,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213359,
                  "doc_count": 1
                },
                {
                  "1": {
                    "value": 0.0003004000000146334
                  },
                  "key": 213360,
                  "doc_count": 1
                }
              ]
            },
            "key": "IOST/BTC",
            "doc_count": 1
          }
        ]
      }
    },
    "status": 200
  </code></pre>
  
  <p>And discovery tab confirms that my data is there and should be retrieving the right price from the <code>order.price</code></p>
  
  <p>What is more strange is, when I flatten my data and stop using an array of nested orders the same graph will work. Am I doing anything wrong while building my graph? I need to fix this because my source data comes in that structure,  it has a nested array of orders for each label</p>