title: Do aggregation from values based in 2 different fields in elasticsearch
body: <p>I have indexed documents like the following</p>
  
  <pre><code>{
  "category" : "student",
  "name" : "John",
  "state" : "Florida",
  "grade": "A"
  }
  </code></pre>
  
  <p>What i need to do is a double layered aggregation on the fields "state" and "grade". That is ,basically I want to know the grade distribution per state. So the normal way to do this is to apply aggregation on the field "state" and nest one inside that aggregation on the field "grade". But can I do the same in just one step?</p>