# Boosting specific documents in every search

**URL:** <https://discuss.elastic.co/t/boosting-specific-documents-in-every-search/106183>\
**Category:** Elasticsearch\
**Created:** [November 2, 2017, 12:00pm UTC](https://discuss.elastic.co/t/boosting-specific-documents-in-every-search/106183 "2017-11-02T12:00:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [November 3, 2017, 11:53pm UTC](https://discuss.elastic.co/t/boosting-specific-documents-in-every-search/106183/2 "2017-11-03T23:53:12Z")

</div>

You could wrap your query in a `function_score` query. This query allows you to provide a filter. Any document that matches the filter (in addition to your original query) will get their score modified according to a `boost_mode` and a `weight`. By setting `boost_mode` to `multiply` and `weight` to `100`, those documents matching the filter will get their score multiplied by 100. Like this:

```
GET _search
{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": [
            {
              "bool": {
                "should": [
                  {
                    "multi_match": {
                      "type": "best_fields",
                      "query": "exampleKeyword",
                      "fields": [
                        "exampleField1^0",
                        "exampleField2^50",
                        "exampleField3^10",
                        "exampleField4^10",
                        "exampleField5^5"
                      ],
                      "boost": 50
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      "functions": [
        {
          "filter": {
            "terms": {
              "Field6": [
                1,
                2,
                3,
                42
              ]
            }
          },
          "weight": 100
        }
      ],
      "boost_mode": "multiply"
    }
  }
}
```

---

_[View the full topic](https://discuss.elastic.co/t/boosting-specific-documents-in-every-search/106183)._
