title: How can I write this complex query in elasticsearch
body: <p>How can I get the following complex query written in elasticsearch</p>
  
  <pre><code>select username, count(id), 
    concat(YEAR(postedtime),'-',MONTH(postedtime),'-',DAY(postedtime),' ',HOUR(postedtime)) 
  from table 
  where username in ("user1", "user2", "user3") 
  group by username, 
    concat(YEAR(postedtime),'-',MONTH(postedtime),'-',DAY(postedtime),' ',HOUR(postedtime));
  </code></pre>