# Multimatch + Boosting Query

**URL:** <https://discuss.elastic.co/t/multimatch-boosting-query/59859>\
**Category:** Elasticsearch\
**Created:** [September 6, 2016, 9:11am UTC](https://discuss.elastic.co/t/multimatch-boosting-query/59859 "2016-09-06T09:11:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Burnham](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@Ryan\_Burnham](https://discuss.elastic.co/u/Ryan_Burnham)\
**Post date:** [September 6, 2016, 9:11am UTC](https://discuss.elastic.co/t/multimatch-boosting-query/59859/1 "2016-09-06T09:11:57Z")

</div>

Is it possible to use MultiMatch and Boosting Query together. I'm trying to match againts 3 or so fields and there are some specific terms (words) that should be a lower score than the others.

my template currently looks like this

```
"template": {
"query": {
  "bool": {
    "should": [
      {
        "multi_match": {
          "type": "most_fields",
          "query": "{{searchQuery}}",
          "fields": [
            "title^4",
            "label_names^2",
            "body"
          ]
        }
      }
    ]
  }
}

```

}

Its currently wrapped in a bool query because i was trying to make the template support a dynamic amount of searchQuery inputs. But that's another issue to sort out later.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 9, 2016, 11:26am UTC](https://discuss.elastic.co/t/multimatch-boosting-query/59859/2 "2016-09-09T11:26:50Z")

</div>

Hey,

the documentation shows that this is possible, see [per field boosting](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-dsl-multi-match-query.html#_literal_fields_literal_and_per_field_boosting). Did I misread your question maybe? 🙂

--Alex

---

<div class="post-metadata">

**Author:** ![Ryan\_Burnham](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@Ryan\_Burnham](https://discuss.elastic.co/u/Ryan_Burnham)\
**Post date:** [September 12, 2016, 1:33am UTC](https://discuss.elastic.co/t/multimatch-boosting-query/59859/3 "2016-09-12T01:33:24Z")

</div>

Sorry i may not have explain this well. Basically i wanted to use the query above but there are a keywords in our label\_names fields (which is just like an array of tags) that is causing some false positives.

I think i ended up resolving this but had to split it out into multiple matches like this

```
"template": {
"query": {
  "filtered": {
    "query": {
      "bool": {
        "should": [
          {
            "match": {
              "title": {
                "query": "{{useCase}}",
                "boost": 0.5
              }
            }
          },
          {
            "boosting": {
              "positive": {
                "match": {
                  "label_names": {
                    "query": "{{labelNames}}",
                    "boost": 0.75, 
                    "analyzer": "camel_analyzer"
                  }
                }
              },
              "negative": {
                "match": {
                  "label_names": "device, device info, device information"
                }
              },
              "negative_boost": 1
            }
          },
          {
            "match": {
              "body": {
                "query": "{{useCase}}",
                "boost": 0.5
              }
            }
          }
        ]
      }
    }
  }
}

```

}

If there is still a way to do this with a MultiMatch it might make it more manageable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:21pm UTC](https://discuss.elastic.co/t/multimatch-boosting-query/59859/4 "2017-07-05T22:21:17Z")

</div>


