title: Solr Search Facets: How to compute stats on facet counts
body: <p>Suppose you have a group of counts of ages such as:</p>
  
  <p><a href="http://localhost:8983/solr/pp/select?q=*:*&amp;facet=true&amp;facet.field=age&amp;facet.stats=age&amp;rows=0" rel="nofollow">http://localhost:8983/solr/pp/select?q=*:*&amp;facet=true&amp;facet.field=age&amp;facet.stats=age&amp;rows=0</a></p>
  
  <p><code>&lt;response&gt;
      &lt;lst name="age"&gt;
          &lt;int name="30"&gt;40&lt;/int&gt;
          &lt;int name="35"&gt;20&lt;/int&gt;
          &lt;int name="33"&gt;10&lt;/int&gt;
      &lt;/lst&gt;
  &lt;/response&gt;</code></p>
  
  <p>How can you compute stats on those values?
  For instance, example results:<br />
  mean: 23.33<br />
  max: 40<br />
  stddev: 15.27</p>
  
  <p>I can't seem to find examples where the stats fields on computed on the values (40, 20, 10) instead of the names (30, 35, 33). You can obviously do this yourself on the client side, but we are working with millions of records and there is a performance benefit of computing the value in solr itself.</p>