Boosting Query not working properly

I am using version 6.2 of elasticsearch and seems like the boosting query is not working.

I am making simple queries and the negative clause does not seem affect the score. I am using explain so that i can verify details of scoring, but i find nothing related to the negative query.

Can someone help me, is this a known bug?

This is the last query that i tried, returning two documents and giving a negative boost to one of them, but it seems like boosting query is not working properly.

{
  "_source": [
    "sku",
    "name"
  ],
  "size": 2,
  "explain": true,
  "query": {
    "boosting": {
      "positive": {
        "bool": {
          "filter" : {
              "terms" : {"sku": ["1421","31234"]}
          },
          "should": [
            {
              "bool": {
                "should": [
                  {
                    "term": {
                      "departments.categories.slugName": {
                        "value": "shampoo",
                        "boost": 1
                      }
                    }
                  }
                ],
                "boost": 1
              }
            }
          ],
          "boost": 1
        }
      },
      "negative": {
        "term": {
          "sku": "1421"
        }
      },
      "negative_boost": 0.8,
      "boost": 1
    }
  }
}

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