title: Elastic search aggregation buckets remain empty
body: <p>Since updating to ES 6.4 my aggregations return empty buckets. This is what the aggregation look like:</p>
  
  <pre><code>"measurements": {
              "terms": {
                  // This decides the number of buckets
                  "size": 20,
                  "field": "measurements.raw"
              }
          },
          "part_type": {
              "terms": {
                  "size": 20,
                  "field": "part_type.raw"
              }
          }
  </code></pre>
  
  <p>This used to work perfectly. The mapping for this parts are: </p>
  
  <pre><code>"parts": {
      "properties": {
         "measurements": {
             "type": "text",
             "fields": {
                 "keyword": {
                     "type": "keyword",
                     "ignore_above": 256
                     }
                   }
                 },
                 "part_type": {
                     "type": "text",
                     "fields": {
                         "keyword": {
                             "type": "keyword",
                             "ignore_above": 256
                                  }
                              }
                  },
   },
  </code></pre>
  
  <p>Somehow the buckets remain empty Arrays and I can't seem to figure out why. There is now error in the query.</p>
  
  <p>A sample data return from a query search is:</p>
  
  <pre><code> {
              "_index": "certificates",
              "_type": "certificate",
              "_id": "56a74f7c5dee788d0c3bc86f",
              "_score": 1,
              "_source": {
                  "certificate_number": "A10288",
                  "certificate_type": "3.1B",
                  "norm": "",
                  "material_quality": "904L",
                  "manufacturer": "BLABLA",
                  "bb_code": "xxx",
                  "attached_file": {
                      "originalname": "",
                      "filename": ""
                  },
                  "parts": [
                      {
                          "measurements": "Ø73.02x5.16",
                          "charge_number": "442665",
                          "probe_number": "",
                          "part_type": "ELBOW",
                          "comment": "",
                          "factory_code": "",
                          "_id": "56a74f7c5dee788d0c3bc870",
                          "mcl_order_number": [
                              {
                                  "number": "43.9.069"
                              }
                          ]
                      }
                  ],
                  "created_by": {
                      "user_name": "System import"
                  },
                  "__v": 0
              }
          }
  </code></pre>
  
  <p>I've tried to rewrite is according to the 6.4 docs to make it look like this:</p>
  
  <pre><code>aggregations = {
      "parts": {
          "terms": {"field": "parts"},
          "aggs": {
              "measurements": {
                  "terms": {"field": "parts.measurements.raw"}
              },
              "part_type": {
                  "terms": {"field": "parts.part_type.raw"}
              },
          }
      }
  }
  </code></pre>
  
  <p>This returns the following:</p>
  
  <pre><code>"aggregations": {
      "parts": {
          "doc_count_error_upper_bound": 0,
          "sum_other_doc_count": 0,
          "buckets": []
      }
  }
  </code></pre>