'dis_max'

The dis_max clause allows you to select the highest score of a list of subqueries.

Example:

{
  "query": {
    "dis_max": {
      "queries": [
        {
          "match": {
            "State": "MA"
          }
        },
        {
          "match": {
             "City": "Boston"
          }
        }
      ]
    }
  }
}

In the above example, matched documents will be assigned with a score based on the TF-IDF formula and the maximum score will be returned.

Last updated