title: How do I combine multiple queries in ElasticSearch
body: <p>For reference here is the code. I am trying to make a hubot plugin that logs to elasticsearch and then uses hubot commands to search those logs.</p>
  
  <p><a href="https://gist.github.com/4050748">https://gist.github.com/4050748</a></p>
  
  <p>I am trying to retrieve records that match two queries.</p>
  
  <pre><code>{ 
    query: { 
          match: {
            user: "SomeUsername" 
          }, 
          range: {
            date: {
              from: (Date.now() - 3600) 
            }
          }
    },
    size: 50 
  }
  </code></pre>
  
  <p>I was expecting:</p>
  
  <ul>
  <li>Up to 50 records</li>
  <li>records that had the given user</li>
  <li>records in the last hour</li>
  </ul>
  
  <p>I got:</p>
  
  <ul>
  <li>up to 10 records</li>
  <li>records that had the given user</li>
  <li>from any time</li>
  </ul>
  
  <p>How do I get all the records with some username in the last hour? Do I need to use match_all with filters? Is what I am attempting unsupported?</p>
  
  <p>In SQL it would be something like:</p>
  
  <pre><code>Select (*) from messages where user_name = ? and time &gt; ?
  </code></pre>