Elastic Search. Search by sub-collection value
<p>Need help with specific ES query.
I have objects at Elastic Search index. Example of one of them (Participant):</p>

<pre><code>{
        "_id": null,
        "ObjectID": 6008,
        "EventID": null,
        "IndexName": "crmws",
        "version_id": 66244,
        "ObjectData":             {
           "PARTICIPANTTYPE": "2",
           "STATE": "ACTIVE",
           "EXTERNALID": "01010111",
           "CREATORID": 1006,
           "partAttributeList":               
           [
              {
                 "SYSNAME": "A",
                 "VALUE": "V1"
              },
              {
                 "SYSNAME": "B",
                 "VALUE": "V2"
              },
              {
                 "SYSNAME": "C",
                 "VALUE": "V2"
              }
           ],
           ....
</code></pre>

<p>I need to find the only entity(s) by partAttributeList entities. For example whole Participant entity with SYSNAME=A, VALUE=V1 at the same entity of partAttributeList.</p>

<p>If i use usul matches:</p>

<pre><code>{"match": {"ObjectData.partAttributeList.SYSNAME": "A"}},
{"match": {"ObjectData.partAttributeList.VALUE": "V1"}}
</code></pre>

<p>Of course I will find more objects than I really need. Example of redundant object that can be found:</p>

<pre><code>              ...
              {
                 "SYSNAME": "A",
                 "VALUE": "X"
              },
              {
                 "SYSNAME": "B",
                 "VALUE": "V1"
              }..
</code></pre>