title: Elasticsearch Function Score Query with Should Clause in Bool Query
body: <p>This is a story of 2 queries. One returns results, while the other does not. Why?</p>
  
  <p>Query that returns results:</p>
  
  <pre><code>{
     "index":"my_index",
     "type":"places",
     "body":{
        "from":0,
        "size":"12",
        "sort":{
           "_score":{
              "order":"desc"
           }
        },
        "query":{
           "function_score":{
              "query":{
                 "bool":{
                    "must":[
  
                    ],
                    "should":[
  
                    ],
                    "must_not":[
  
                    ],
                    "filter":[
  
                    ]
                 }
              },
              "functions":[
                 {
                    "gauss":{
                       "location":{
                          "origin":{
                             "lat":"41.243368",
                             "lon":"-116.79711"
                          },
                          "offset":"0mi",
                          "scale":"100mi"
                       }
                    }
                 }
              ],
              "score_mode":"sum",
              "boost_mode":"sum"
           }
        }
     }
  }
  </code></pre>
  
  <p>Query that does NOT return results:</p>
  
  <pre><code>{
     "index":"my_index",
     "type":"places",
     "body":{
        "from":0,
        "size":"12",
        "sort":{
           "_score":{
              "order":"desc"
           }
        },
        "query":{
           "function_score":{
              "query":{
                 "bool":{
                    "must":[
  
                    ],
                    "should":[
                       {
                          "terms":{
                             "region_id":[
                                32273
                             ],
                             "boost":2
                          }
                       }
                    ],
                    "must_not":[
  
                    ],
                    "filter":[
  
                    ]
                 }
              },
              "functions":[
                 {
                    "gauss":{
                       "location":{
                          "origin":{
                             "lat":"41.243368",
                             "lon":"-116.79711"
                          },
                          "offset":"0mi",
                          "scale":"100mi"
                       }
                    }
                 }
              ],
              "score_mode":"sum",
              "boost_mode":"sum"
           }
        }
     }
  }
  </code></pre>
  
  <p>The Bool Query has only a Should Clause. </p>
  
  <p>Also, I am summing the scores, not multiplying them.</p>
  
  <p>It's true that I do not have any items in the index that have the specified "region_id", but I fail to see how the results of the first query are excluded from the second query. It seems like the 0 score on the Bool Query is acting like a filter.</p>