title: Provide a negative score when not matched in Elasticsearch Query
body: <p>I am working on a crazy requirement, crazy because I have never done that and from the look of it I don't think it can be done directly. Looking for help in this platform if someone can help me out. </p>
  
  <p>The requirement is in Elasticsearch if a value matches then I have to provide a score, but if the field is present but doesn't matches then provide a negative score which when latter summed will decrease the score. 
  Example lets say I am searching for two fields name and subject. If name matches then the score provided is 50, if subject is match then the score is 10 . So if both matches then score is 60. If subject is not matched then score is -10 which when gets added gives me 40. </p>
  
  <p>This is easy in terms of some programming language but unable to do so in Elasticsearch query. I am using function scoring, below is sample query.
  Any help in this regard is appreciated.  </p>
  
  <pre><code>GET dummy_rps_index_2/_search
  {
    "query": {
      "bool": {
        "must": [
          {
            "dis_max": {
              "queries": [
                {
                  "function_score": {
                    "boost_mode": "replace",
                    "score_mode": "max",
                    "max_boost": 100,
                    "query": {
                      "bool": {
                        "disable_coord": true,
                        "minimum_should_match": 1,
                        "should": [
                          {
                            "function_score": {
                              "score_mode": "max",
                              "boost_mode": "replace",
                              "_name": "name_match",
                              "query": {
                                "multi_match": {
                                  "query": "TIFFIN",
                                  "fields": [
                                  "name"
                                  ],
                                  "operator": "or",
                                  "fuzziness": "AUTO"
                                }
                              },
                              "functions": [
                                {
                                  "filter": {
                                    "multi_match": {
                                      "query": "TIFFIN",
                                      "fields": [
                                        "name"
                                      ],
                                      "operator": "or",
                                      "fuzziness": 0
                                    }
                                  },
                                  "weight": 50
                                }
                              ]
                            }
                          },
                          {
                            "function_score": {
                              "score_mode": "max",
                              "boost_mode": "replace",
                              "_name": "multipleline_code",
                              "query": {
                                "bool": {
                                  "disable_coord": true,
                                  "minimum_should_match": 1,
                                  "should": [
                                    {
                                      "function_score": {
                                        "boost_mode": "replace",
                                        "query": {
                                          "multi_match": {
                                            "query": "maths",
                                            "fields": [
                                              "subject
                                            ]
                                          }
                                        },
                                        "functions": [
                                          {
                                            "weight": 10
                                          }
                                        ]
                                      }
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        ]                      
                      }
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
  </code></pre>