title: ElasticSearch - How can i apply a filter over the results of the query to limit the document that have a certain value
body: <p>I have a question regarding elastic search but I am not sure where to start searching or which precise operation I should search for using google.</p>
  <p>Let say I have a document with data and one of its fields is &quot;<code>the_best</code>&quot; (which is a boolean). The thing is (currently), over 48 results (given by a working query), I have like 15 documents returned with <code>the_best</code> field set to true.</p>
  <p>Now, I would like to limit this by only 2 maximum documents set to <code>true</code> over the results. So now, it (elasticsearch) should now return 35 results (if we stik at the story above):</p>
  <ul>
  <li>Base (out of 48results): [15 the_best=true, 33 the_best=false]</li>
  <li>Expected (with max 2 <code>the_best=true</code>): I should get 35 results [<strong>2 the_best=true</strong>, 33 the_best=false])</li>
  </ul>
  <p>Any idea? :)</p>