title: Elasticsearch - Aggregation on multiple fields in the same nested scope
body: <p>I'm aggregating product search results by tags, which have a name and ID fields. How do I get both fields back in an aggregation bucket? I can get one or the other, but I can't figure out how to get both. <strong>BTW, script access is turned off on my cluster, so I can't use that.</strong></p>
  
  <p>Here's my product mapping (simplified for this question):</p>
  
  <pre><code>"mappings": {
      "products": {
          "properties": { 
              "title": {
                  "type": "string"
              },
              "description": {
                  "type": "string"
              },
              "topics": {
                  "properties": {
                      "id": {
                          "type": "string",
                          "index": "not_analyzed"
                      },
                      "name": {
                          "type" : "string",
                          "index": "not_analyzed"
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Here's my query:</p>
  
  <pre><code>"query": {
      "multi_match": {
          "query": "Testing 1 2 3",
          "fields": ["title", "description"]
      },
      "aggs": {
          "Topics": {
              "terms": {
                  "field": "topics.id",
                  "size": 15
              }
          }
      }
  }
  </code></pre>
  
  <p>My aggregation buckets look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Aztu4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Aztu4.png" alt="enter image description here"></a></p>
  
  <p>...the "key" value in the first bucket is the topics.id field value. Is there a way to add my topics.name field to the bucket?</p>