Hi guys,
Re 5.0 Boosting Queries
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html
I'm interested in the best way to boost scores based on the importance of kinds of text (e.g. titles, comments), etc.
I'm experimenting with a mapping that uses a nested object containing 2 fields: text and weight, and I want to boost scores at query time based on the values of the weight field.
Is this possible with the "boosting" query? From results using the query below, I see that the docs that match the "positive" clause are boosted, but scores for other docs are unchanged. Am I doing something wrong?
{
  "query": {
    "bool": {
      "must": {
        "nested": {
          "path": "content",
          "score_mode": "avg",
          "query":  {
            "bool": {
              "must":
                [
                  {"match": {"content.text": "aid"} }
                ],
              "should": 
                 {"boosting": {
                    "positive": {
                      "term" : {"content.weight": 2}
                    },
                    "negative": {
                      "term" : {"content.weight": 0}
                    },                    
                    "negative_boost": 0.5
                  }
                 }
            }
          }
          }
        }                   
      }
  }  
}
I have documents with weight values of 0,1,2; the only scores affected based on my tests are those with weight 2.
Thanks!