title: How to do multi value count aggregation in elasticsearch
body: <p>Is there a way to do a "multi value count" aggregation?
  It would work the same way as the regular value count: <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html" rel="nofollow">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html</a></p>
  
  <p>But would be used to count multiple fields.</p>
  
  <p>For example we have a mapping:</p>
  
  <pre><code>"properties" : {
          "lastName" : { "type" : "string" },
          "firstName" : { "type" : "string" },
          "age" : { "type" : "string" }
  }
  </code></pre>
  
  <p>And the following 4 docs:</p>
  
  <pre><code>{"lastName":"Smith"}
  {"lastName":"Jacobson", "firstName":"Scott"}
  {"lastName":"Bush", "age": 68}
  {"lastName":"Obama", "firstName":"Barack", "age":53}
  </code></pre>
  
  <p>I would like to count the number of documents with either an age OR a first name.
  In my case the aggregation would return 3.</p>
  
  <p>Any idea ? I try a little bit using the script function:</p>
  
  <pre><code>"aggregation_name" : {
    "value_count" : {
      "script" : "doc['age'].value + doc['firstName'].value"
    }
  }
  </code></pre>
  
  <p>but it did't seem to work.</p>
  
  <p>Thanks!</p>