Utkarsh Singh
Utkarsh Singh

Reputation: 1

Scoring issues while using BM25Similarity

While tinkering solr scores in a custom BM25Similarity class using solr params, I find that the scores are logged correctly but score of docs for the same query does not change after the calculation is compiled once.

Although in the explain section of response I see the scores being calculated correctly.

    @Override
    public float score(float freq, long encodedNorm) {
      float normInverse = cache[((byte) encodedNorm) & 0xFF];
      freq = Math.min(freq, maxTf);
      return (weight - weight / (1f + freq * normInverse)) * constant;
    }

This is my score function and "constant" is something derived from a solrParam from a queryParser class. When logged, it shows extraction of constant and the score returned here is all good but in the response the score isn't reflecting.

Upvotes: 0

Views: 64

Answers (0)

Related Questions