You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Christine Poerschke (Jira)" <ji...@apache.org> on 2020/11/03 16:42:00 UTC

[jira] [Commented] (LUCENE-9542) Score returned in search request is original score and not reranked score

    [ https://issues.apache.org/jira/browse/LUCENE-9542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17225542#comment-17225542 ] 

Christine Poerschke commented on LUCENE-9542:
---------------------------------------------

Thanks [~krishan1390] for the clarification that this was happening on the LTR reranker when "sort" is present and thanks [~Baik] for the reproducing unit test and analysis!

Based on that then here's a {{techproducts}} request/response illustration:
{code:java}
$ curl 'http://localhost:8983/solr/techproducts/select?fl=id,score&q=inStock:true&fq=cat:memory&rq=\{!rerank+reRankQuery=id:VDBDB1A16\}&sort=score+desc'
{
  "responseHeader":{
    "status":0,
    "QTime":3,
    "params":{
      "q":"inStock:true",
      "fl":"id,score",
      "fq":"cat:memory",
      "sort":"score desc",
      "rq":"{!rerank reRankQuery=id:VDBDB1A16}"}},
  "response":{"numFound":3,"start":0,"maxScore":0.10401889,"numFoundExact":true,"docs":[
      {
        "id":"VDBDB1A16",
        "score":2.9140575},
      {
        "id":"TWINX2048-3200PRO",
        "score":0.10401889},
      {
        "id":"VS1GB400C3",
        "score":0.10401889}]
  }}
{code}
vs.
{code:java}
$ curl 'http://localhost:8983/solr/techproducts/select?fl=id,score&q=inStock:true&fq=cat:memory&rq=\{!rerank+reRankQuery=id:VDBDB1A16\}&sort=score+desc,id+asc'
{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"inStock:true",
      "fl":"id,score",
      "fq":"cat:memory",
      "sort":"score desc,id asc",
      "rq":"{!rerank reRankQuery=id:VDBDB1A16}"}},
  "response":{"numFound":3,"start":0,"maxScore":0.10401889,"numFoundExact":true,"docs":[
      {
        "id":"VDBDB1A16",
        "score":0.10401889},
      {
        "id":"TWINX2048-3200PRO",
        "score":0.10401889},
      {
        "id":"VS1GB400C3",
        "score":0.10401889}]
  }}
{code}
(I'm going to move this JIRA ticket across from LUCENE to SOLR for visibility and since this concerns the {{SolrIndexSearcher}} class. Any use of https://issues.apache.org/jira/browse/LUCENE-9542 should then redirect seamlessly to the SOLR ticket.)

> Score returned in search request is original score and not reranked score
> -------------------------------------------------------------------------
>
>                 Key: LUCENE-9542
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9542
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 8.0
>            Reporter: Krishan
>            Priority: Major
>         Attachments: 0001-LUCENE-9542-Unit-test-to-reproduce-bug.patch
>
>
> 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
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org