title: Malformed Elastic query when defining 2 filters with a multi_match
body: <p>I am having difficulty, combining a multi_match query with 2 filters.</p>
  <p>I am using Elastic 7.17 and am specifying the query with PHP.</p>
  <p>The error is as follows:</p>
  <pre><code>{
      &quot;error&quot;: {
          &quot;root_cause&quot;: [{
              &quot;type&quot;: &quot;parsing_exception&quot;,
              &quot;reason&quot;: &quot;[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]&quot;,
              &quot;line&quot;: 1,
              &quot;col&quot;: 170
          }],
          &quot;type&quot;: &quot;x_content_parse_exception&quot;,
          &quot;reason&quot;: &quot;[1:170] [bool] failed to parse field [filter]&quot;,
          &quot;caused_by&quot;: {
              &quot;type&quot;: &quot;parsing_exception&quot;,
              &quot;reason&quot;: &quot;[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]&quot;,
              &quot;line&quot;: 1,
              &quot;col&quot;: 170
          }
      },
      &quot;status&quot;: 400
  }
  </code></pre>
  <p>The parser is fine with each of the filters individually, if I comment one out, the other works ok, but as soon as I have both uncommented I get an error.</p>
  <p>This presumably suggests that it is the way I am defining multiple filters that is the issue?</p>
  <p>However, the query I am building is almost exactly the same as an official Elastic example.</p>
  <p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-filter-context.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-filter-context.html</a></p>
  <p>My query is here:</p>
  <pre><code>            'query' =&gt; [
                  'bool' =&gt; [
                      'must' =&gt; [
                          'multi_match' =&gt; [
                              'query' =&gt; $keywords,
                              'fields' =&gt; [
                                  'title^4',
                                  'subtitle^4',
                              ]
                          ],
                      ],
                      'filter' =&gt; [
                          'term' =&gt; [
                              'status' =&gt; 'live'
                          ],
                          'range' =&gt; [
                              'published_date' =&gt; [
                                  'lte' =&gt; '2022-11-01'
                              ]
                          ]
                      ]
                  ]
              ]
  </code></pre>