title: Elastic Search: parse_exception: failed to parse search source. expected field name but got [START_OBJECT]
body: <p>I'm new in <code>Elastic Search</code> and using ES in my application. When I run simple query on single table on ES then it working file.. But When I'm using nested query then it is not giving me proper result. </p>
  
  <p>Basically, I have two tables <code>people</code> and <code>interactions</code> both are separate tables. And interaction table has person_id which refer to people table id. and I want to fetch those interaction of people which have <code>user_id: 2</code>. When I'm creating condition and running the query then I'm getting error. </p>
  
  <p>Below is my query which I'm running.</p>
  
  <pre><code>{
    "index": "my_index",
    "type": "people",
    "fields": "_source,_timestamp",
    "size": 10,
    "from": 0,
    "body": {
      "query": {
        "bool": {
          "should": {
            "wildcard": {
              "_all": "*a*"
            }
          }
        },
        "nested": {
          "path": "interactions",
          "query": {
            "bool": {
              "should": {
                "match": {
                  "interactions.user_id": 2
                }
              }
            }
          }
        }
      },
      "sort": [
        {
          "last_name": {
            "order": "asc"
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p>Below is the response which I'm getting</p>
  
  <pre><code>{
    "status": false,
    "error_code": 657,
    "errors": [
      "parse_exception: failed to parse search source. expected field name but got [START_OBJECT]"
    ]
  }
  </code></pre>
  
  <p>Below is the data which we index in ES</p>
  
  <p><strong>People</strong></p>
  
  <pre><code>[
      {
          "id": 1,
          "first_name": "Test1",
          "last_name": "Data1",
          "date_of_birth": "1988-11-02",
          "created_at": ".......",
          "updated_at": ".......",
          "status": 1,
          "prefix": "Ms.",
          "suffix": "MD"
      },
      {
          "id": 1,
          "first_name": "Test2",
          "last_name": "Data2",
          "date_of_birth": "1988-11-02",
          "created_at": ".......",
          "updated_at": ".......",
          "status": 1,
          "prefix": "Ms.",
          "suffix": "MD"
      }
  ]
  </code></pre>
  
  <p><strong>Interactions</strong></p>
  
  <pre><code>[
      {
          "id": 1,
          "user_id": 11,
          "person_id": 6,
          "interaction_type": 1,
          "initiated_by": 2,
          "created_at": ".......",
          "updated_at": "......."
      },
      {
          "id": 2,
          "user_id": 10,
          "person_id": 5,
          ..........
      }
  ]
  </code></pre>
  
  <p>Can anyone suggest me what I'm doing wrong in this query?
  Thanks in Advance.</p>