title: bool query malformed, no start_object after query name
body: <p>I've been messing around with this for a while but can't get it right. I've tried several different ways of displaying this query. For example, I've made each param inside of bool a key instead of an array element. As it is now it's an array element. Either way ES doesn't seem to like it.  What would be the proper format for the following query?  </p>
  
  <p>What it's supposed to do:</p>
  
  <p>This is PHP. The should query is either in between two dates and must have the status ended OR it must start at one date and the status cannot be ended.</p>
  
  <pre><code>                      [
                              'index' =&gt; 'quotes',
                              'type' =&gt; 'title',
                              'body' =&gt; [
                              'query' =&gt; [
                                  "function_score" =&gt; [
                                      'query' =&gt; [
                                      'bool' =&gt; [
                                          'filter' =&gt; [
                                              ["range"  =&gt; ["number_of_quotes" =&gt; ["gt" =&gt; 0]]],
                                              ["exists" =&gt; ["field" =&gt; "vote-average"]],
                                              ["exists" =&gt;["field" =&gt; "first-air-date"]],
                                              ["exists" =&gt;["field" =&gt; "last-air-date"]],
  
                                          ],
                                          'should' =&gt; [
                                              ['bool' =&gt; [
                                                  ["range" =&gt; ["first-air-date" =&gt; [
                                                          "gte" =&gt; "$begin",
                                                          "format" =&gt; "yyyy"
                                                      ],
                                                      ["last-air-date" =&gt; [
                                                          "lte" =&gt; $begin,
                                                          "format" =&gt; "yyyy"
                                                      ]],
                                                  ]],
                                                  ["must" =&gt; [
                                                      "match" =&gt; [
                                                          "status" =&gt; "Ended"
                                                      ]
                                                  ]
                                              ]], 
  
                                          ],
                                          ['bool' =&gt; [
                                              ["range" =&gt; ["first-air-date" =&gt; [
                                                  "gte" =&gt; "$begin",
                                                   "format" =&gt; "yyyy"
                                              ]]],
                                              ["must_not" =&gt; [
                                                  "match" =&gt; [
                                                      "status" =&gt; "Ended"
                                                  ]
                                              ]
                                          ]], 
  
                                      ]]],
                                      ]
                                  ],
                              ],  
                          ],       
                          "from" =&gt; (int) $skip,
                          "size" =&gt; (int) $take,
                          ];
  </code></pre>