Multimatch + Boosting Query

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.

Hey,

the documentation shows that this is possible, see per field boosting. Did I misread your question maybe? :slight_smile:

--Alex

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.