title: Elasticsearch nested filter query
body: <p>Here's an example of my json document I'm trying to create a query against. The "params" field is mapped as "nested".</p>
  
  <pre><code>{
     "images": [
        {
           "name": "1907183375555f7c44126f23.67610475.png"
        },
        {
           "name": "5693836375575c567764bc2.87695507.png"
        }
     ],
     "sku": "MYSKU",
     "class": "some_class",
     "params": [
        {
           "name": "item1",
           "value": "item1value"
        },
        {
           "name": "item2",
           "value": "item2value"
        },
        {
           "name": "item3",
           "value": "item3value"
        },
        {
           "name": "item4",
           "value": "item4value"
        },
        {
           "name": "item5",
           "value": "item5value"
        }
     ]
  }
  </code></pre>
  
  <p>How do I create a filtered query that will search on the sku, class, and nested params? E.g. in pseudocode, I would have a "bool" "must" on the sku and class, and then a "nested" "filter" "bool" "must" on each of the params that make up the document.  At <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-filter.html" rel="nofollow">https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-filter.html</a> I can see how one would use nested on a document where each nested field was a unique field name, but in my document each array element has "name" and "value".</p>
  
  <p>Seems like this should be simple.</p>