title: How to query for two fields in one and the same tuple in an array in ElasticSearch?
body: <p>Let's say there are some documents in my index which look like this:</p>
  
  <pre><code>{
    "category":"2020",
    "properties":[
      {
       "name":"foo",
       "value":"2"
      },
      {
       "name":"boo",
       "value":"2"
      }
    ]
  },
  {     
    "category":"2020",
    "properties":[
      {
       "name":"foo",
       "value":"8"
      },
      {
       "name":"boo",
       "value":"2"
      }
    ]
  }
  </code></pre>
  
  <p>I'd like to query the index in a way to return only those documents that match <code>"foo":"2"</code>but not <code>"boo":"2"</code>. </p>
  
  <p>I tried to write a query that matches both <code>properties.name</code> <em>and</em> <code>properties.value</code>, but then I'm getting false positives. I need a way to tell ElasticSearch that name and value have to be part of the <em>same</em> properties tuple.</p>
  
  <p>How can I do that?</p>