Multiple boost queries

Hello, i've been trying to find the right format for a mutliple boost query for the last hour, could someone assist me in writing this correctly? essentially it is a single query that can do the below many times.

This Works

{
    "query": {
        "match" : {
            "title": {
                "query": "brain",
                "boost": 2
            }
        }
    }
}

This is what i am trying to achieve but does not work. One normal term to search in title and two other boosted terms to also prioritise in title.

{
    "query": {
        "match" : {
           "title": {
                "query": "neuron",
            },
            "title": {
                "query": "brain",
                "boost": 2
            },
                "query": "birdsong",
                "boost": 3
            }
        }
    }
}

Another thing i'd like to clarify is that in order for ElasticSearch to understand queries like the above from a web application they must be submitted as a Post HTTP request?

I needed to issue a bool/should query like this:

POST index/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "title": {
              "query": "neuron"
            }
          }
        },
        {
          "match": {
            "title": {
              "query": "brain",
              "boost": 2
            }
          }
        },
        {
          "match": {
            "title": {
              "query": "birdsong",
              "boost": 3
            }
          }
        }
      ]
    }
  }
}

And both GET and POST are accepted when sending a query.

Answer received on stackoverflow.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.