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

Krishan commented on LUCENE-9542:
---------------------------------

Hey [~cpoerschke], This was happening on the LTR reranker when "sort" is 
present in the request. 

[http://localhost:8983/solr/techproducts/query?q=test&rq=%7B!ltr%20model=myModel%20reRankDocs=100%7D&fl=id,price,score,%5Bfeatures%5D&sort=price%20desc]

The features and models are provided from 
[https://lucene.apache.org/solr/guide/6_6/learning-to-rank.html] 


Unfortunately, I am not able to reproduce right now (so could have been a 
different request structure) but I remember that if cmd.getSort() = null (which 
happens when "sort" is absent in request) the score returned is the reranked 
score. But if cmd.getSort() != null, the score returned is the original score. 


Root cause looked to me that "query" variable is a boolean query where as 
cmd.getQuery() is a type of RankQuery (and RankQuery is explicitly skipped in 
this condition). 

 

If this info is not enough, I can debug further to try to reproduce again and 
provide exact query on the example data. 

> 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
>
> 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-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to