title: Filter by count in elasticsearch
body: <p>Consider the following data</p>
  
  <pre><code>POST programming/languages/1
  {
    "name":"java",
    "type":"general_purpose"
  }
  POST programming/languages/2
  {
    "name":"javascript",
    "type":"scripting"
  }
  POST programming/languages/3
  {
    "name":"c",
    "type":"general_purpose"
  }
  
  GET programming/languages/_search
  {
    "query": {
     "match": {
      "type":"general_purpose"
     }
    }
  }
  </code></pre>
  
  <p>If I need to find the docs which has more than one match of the field <code>type</code>, how do that in elasticsearch ?</p>
  
  <p>Normally using <code>group by</code> with <code>having</code> clause we can achieve this in SQL. 
  Can we achieve this in elasticsearch?</p>