title: How to do an ElasticSearch Select Distinct
body: <p>I just want to do the following request with elasticsearch.</p>
  
  <p>In SQL :</p>
  
  <pre><code>Select distinct(id) from my_table where userid = '20' or activity = '9';
  </code></pre>
  
  <p>I just have :</p>
  
  <pre><code>{
     "query" : {
          "bool" : {
                 "should" : [ 
                    { "term" : { "userid" : "20" } }, 
                    { "term" : { "activity" : "9" } }
                 ]
           }
      }
  }
  </code></pre>
  
  <p>Thanks in advance :)</p>