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

Paul Sanwald commented on LUCENE-8956:
--------------------------------------

Thanks for your review [~jpountz], I've updated the patch. The one area I'm 
struggling to think of a good way is the assertion you mentioned: usually, 
asserting on length doesn't feel like a good check to me, but, for this case, I 
did want to make sure the logic is exercised, so the first query is a term 
query that will match most of the documents in the set, and the second is a 
phrase that should match less and thus return different scores. So, I've added 
a loop that asserts the topN scores are in fact ordered.

Do you recommend to remove some of the randomization and assert on specific 
scores? Or is there another strategy I'm not thinking of?

> QueryRescorer sort optimization
> -------------------------------
>
>                 Key: LUCENE-8956
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8956
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/query/scoring
>            Reporter: Paul Sanwald
>            Priority: Minor
>         Attachments: LUCENE-8956.patch
>
>
> This patch addresses a TODO in QueryRescorer: We should not sort the full 
> array of the results returned from rescoring, but rather only topN, when topN 
> is less than total hits.
>  
> Made this optimization with some suggestions from [~jpountz] and [~jimczi], 
> this is my first lucene patch submission.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to