title: Combine two function_score queries in dis_max
body: <p>I would like to make a query with two subqueries, each of them has it's own scoring based on function_score with script. For example, this subquery:</p>
  
  <pre><code> {
     "query":{
        "function_score":{
           "query":{
              "bool":{
                 "filter":[
                    {
                       "term":{
                          "rooms_count":3
                       }
                    },
                    {
                       "term":{
                          "addresses":"d76255c8-3173-4db5-a39b-badd3ebdf851"
                       }
                    },
                    {
                       "exists":{
                          "field":"zhk_id"
                       }
                    }
                 ]
              }
           },
           "script_score":{
              "script":"1 * doc['price'].value/100000"
           },
           "boost_mode":"replace"
        }
     }
      }
  </code></pre>
  
  <p>works fine, and it's score is based on price (about 190 points). But if I try to combine two subqueries in dis_max query, function_score is not working and I get scores about 1 point.</p>
  
  <p>Explanation for each subquery looks like this </p>
  
  <pre><code>    "value": 100.9416, "description": "script score function, computed with script:"[script: 1 * doc['price'].value/100000, type: inline, lang: null, params: {}]" and parameters:
  {}",
  </code></pre>
  
  <p>for dis_max query like </p>
  
  <pre><code> "value": 1, "description": "ConstantScore(function score (#rooms_count: #addresses:d76255c8-3173-4db5-a39b-badd3ebdf851 #ConstantScore(fieldnames:zhk_id),function=script[script: 1 * doc['price'].value/100000, type: inline, lang: null, params: {}])), product of:",`
  </code></pre>
  
  <p>Can anybody tell me, how to combine function_score queries properly?</p>
  
  <p>My full dis_max query <a href="http://pastebin.com/CfFu6XgA" rel="nofollow noreferrer">on pastebin</a></p>