title: Elasticsearch - Python client - How to match on multiple fields?
body: <p>I'm trying to match on more than one field when querying an ES server via the Python API. But can't figure out the syntax within Python:</p>
  
  <p>I've tried;</p>
  
  <pre><code>res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"} AND {"age": "21"}}}, size=1000)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>res = es.search(index="pyats", doc_type="router_show", body={"query": {"match_all": {"name": "mark"} AND {"age": "21"}}}, size=1000)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"}}, {"match": {"age": "21"}}}, size=1000)
  </code></pre>
  
  <p>Any advice would be greatly appreciated.
  None, seem to be working.         </p>