title: How to join 2 match queries into a query for elasticsearch?
body: <p>I'd like to query for data that <code>user_id</code> is <code>'1'</code> and <code>name</code> is <code>'John'</code>. It's easy to write a commonly-used SQL:</p>
  
  <pre><code>select * from t where user_id = '1' and name = 'John';
  </code></pre>
  
  <p>But it's not easy for me to make a query for elasticsearch.</p>
  
  <p>First, I made a query for <code>user_id</code>:</p>
  
  <pre><code>{
    "query" : {
      "match" : {
        "user_id" : "1"
      }
    }
  }
  </code></pre>
  
  <p>And the results were what I expected.</p>
  
  <p>Then, I made a query for <code>name</code>:</p>
  
  <pre><code>{
    "query" : {
      "match" : {
        "name" : "John"
      }
    }
  }
  </code></pre>
  
  <p>It worked well, too.</p>
  
  <p>But I couldn't make a query joining 2 conditions with and operation. How can I join those 2 match queries into one using and operation?</p>