Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14983

Score returned in search request is original score and not reranked score

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.0
    • Fix Version/s: 8.8, master (9.0)
    • Component/s: None
    • Labels:
      None

      Description

      Score returned in search request is original score and not reranked score post the changes in https://issues.apache.org/jira/browse/LUCENE-8412.

      Commit - https://github.com/apache/lucene-solr/commit/55bfadbce115a825a75686fe0bfe71406bc3ee44#diff-4e354f104ed52bd7f620b0c05ae8467d

      Specifically - 

      if (cmd.getSort() != null && query instanceof RankQuery == false && (cmd.getFlags() & GET_SCORES) != 0)

      {     TopFieldCollector.populateScores(topDocs.scoreDocs, this, query); }

      in SolrIndexSearcher.java recomputes the score but outputs only the original score and not the reranked score.

       

      The issue is cmd.getQuery() is a type of RankQuery but the "query" variable is a boolean query and probably replacing query with cmd.getQuery() should be the right fix for this so that the score is not overriden for rerank queries

       

        Attachments

        1. 0001-LUCENE-9542-Unit-test-to-reproduce-bug.patch
          6 kB
          Jason Baik
        2. SOLR-14983.patch
          6 kB
          Christine Poerschke
        3. SOLR-14983.patch
          6 kB
          Christine Poerschke

          Activity

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              krishan1390 Krishan Goyal
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: