# Boosting Query not working properly

**URL:** <https://discuss.elastic.co/t/boosting-query-not-working-properly/141259>\
**Category:** Elasticsearch\
**Created:** [July 23, 2018, 9:24pm UTC](https://discuss.elastic.co/t/boosting-query-not-working-properly/141259 "2018-07-23T21:24:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre.garcia](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@andre.garcia](https://discuss.elastic.co/u/andre.garcia)\
**Post date:** [July 23, 2018, 9:24pm UTC](https://discuss.elastic.co/t/boosting-query-not-working-properly/141259/1 "2018-07-23T21:24:41Z")

</div>

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
    }
  }
}
```

---

<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:** [August 20, 2018, 9:24pm UTC](https://discuss.elastic.co/t/boosting-query-not-working-properly/141259/2 "2018-08-20T21:24:42Z")

</div>

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