title: Elasticsearch 5 function score with filter doesn't work after upgrade
body: <p>I have upgraded Elasticsearch from version 2 to version 5. Now this query is not working any more..</p>
  
  <pre><code>GET _search {
    "query":{
    "function_score":{
      "functions":[{"field_value_factor":{"field":"popularity"}}],
      "score_mode":"multiply",
  
      "query":{
        "filtered":{
          "query":{"match_all":{}},
            "filter":{
            "bool":{
              "must":[{"term":{"image.colors.color":"red"}}]
             }
           }   
         }
      }
   }
  </code></pre>
  
  <p>I am getting:</p>
  
  <pre><code>no [query] registered for [filtered]
  </code></pre>
  
  <p>I have tried different options without <code>filtered</code> but still no luck. Any ideas?</p>