How to have an attribute value to really make a difference in score? (help with rank_feature needed)

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:

{
  "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.

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