# How to have an attribute value to really make a difference in score? (help with rank\_feature needed)

**URL:** <https://discuss.elastic.co/t/how-to-have-an-attribute-value-to-really-make-a-difference-in-score-help-with-rank-feature-needed/258927>\
**Category:** Elasticsearch\
**Created:** [December 16, 2020, 11:33pm UTC](https://discuss.elastic.co/t/how-to-have-an-attribute-value-to-really-make-a-difference-in-score-help-with-rank-feature-needed/258927 "2020-12-16T23:33:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffknob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ffknob/32/37008_2.png) [@ffknob](https://discuss.elastic.co/u/ffknob)\
**Post date:** [December 16, 2020, 11:33pm UTC](https://discuss.elastic.co/t/how-to-have-an-attribute-value-to-really-make-a-difference-in-score-help-with-rank-feature-needed/258927/1 "2020-12-16T23:33:29Z")

</div>

Hello

we have an attribute in our documents called "popularity", which is a number between 0 and 100. Our goal is to boost the relevance of the results in such a way that the results will look ordered by popularity and then `_score`...

So what's the best way to achieve this?

My current approach it to map "popularity" as a rank\_feature and then search terms with a should clause boosting a `rank_feature` query.

The problem with this is that I was notable to get my boost on "popularity" to really make a difference in the results list. Yes the results started to get ordered by their popularity, but only when I set the boost to 100 was when I achieved a kind of ordered list (even so when I scroll down a couple of results I can see a popularity=37 more relevant than a popularity=38, for instance). I've tried to change the function to logarithmic, with no luck. This is what I have now:

```auto
{
  "query": {
    "bool": {
      "must": [
        {
          "multi_match": {
            "query": "high heels shoes",
            "fields": [
              "description",
              "extra_description"
            ]
          }
        }
      ],
      "should": [
        {
          "rank_feature": {
            "field": "popularity",
            "log": {
              "scaling_factor": 4
            }
          }
        }
      ]
    }
  }
}

```

The problem is that the boost for 37 or for 38 results in a very close value, in such a way that the other scores (`multi_match`), when added to the `rank_feature` score, can invert the order (for exeample when the score for the `multi_match` for the documento with lower popularity is bigger than the one for the document with higher popularity).

So, I think what I need is to make the `rank_feature` really scale from a value to the next one. I guess I can achieve this with the logarithmic function, butt I need some help here.

What do you think?

Thank you.

---

<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:** [January 13, 2021, 11:33pm UTC](https://discuss.elastic.co/t/how-to-have-an-attribute-value-to-really-make-a-difference-in-score-help-with-rank-feature-needed/258927/2 "2021-01-13T23:33:33Z")

</div>

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