title: Return Documents with Null Field in Multi Level Aggregation
body: <p>We are using Multi Level Aggregation. We have Buckets of City and each Bucket has Buckets of Class.
  For Few documents Class is Null and in such cases an empty bucket is returned for the City. Please refer to below response:</p>
  
  <p>Sample Output:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>"aggregations":
  {
    "CITY":{
      "buckets":[
        {
          "key":"CITY 1",
          "doc_count":2
          "CLASS":{
            "buckets":[
              {
                "key":"CLASS A",
                "top_tag_hits":{
                  
                }
              }
            ]
          }
        },
        {
          "key":"CITY 2",
          "doc_count":2
          "CLASS":{
            "buckets":[
              
                
              
            ]
          }
        },
      ]
        
      
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here the key CITY 2 has an empty bucket of CLASS as all documents under key CITY 2 has the field CITY as null. But we are having a doc count.
  How can we return documents under the bucket when terms field is null</p>
  
  <p>Update:
  Field Mapping for CLASS:</p>
  
  <pre><code>"CLASS":
          {
                      "type": "string",
  
                      "index_analyzer": "text_with_autocomplete_analyzer",
                      "search_analyzer": "text_standard_analyzer",
                      "fields": {
                          "raw": {
                              "type": "string",
                               "null_value" : "na",
                              "index": "not_analyzed"
                          },
                          "partial_matching": {
                              "type": "string",
                              "index_analyzer": "text_with_partial_matching_analyzer",
                              "search_analyzer": "text_standard_analyzer"
                          }
                      }
                  }
  </code></pre>
  
  <p>Please refer to mapping to solve the issue.</p>