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

Adrien Grand commented on LUCENE-7996:
--------------------------------------

The gain is a lot of simplicity. If we don't require non-negative scores, then 
we would need some way for scorers to tell whether they may produce negative 
scores and/or additional care to make sure that things still work if negative 
scores are returned via sub scorers or passed to Scorer#setMinCompetitiveScore.

FunctionScoreQuery is probably the easiest way to mistakenly create a scorer 
that returns negative scores, in which case one should sort by the function 
rather than using this function to compute scores (ie. follow the 1st example 
at 
https://lucene.apache.org/core/7_5_0/expressions/org/apache/lucene/expressions/Expression.html
 rather than the 2nd one).

> Should we require positive scores?
> ----------------------------------
>
>                 Key: LUCENE-7996
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7996
>             Project: Lucene - Core
>          Issue Type: Wish
>            Reporter: Adrien Grand
>            Priority: Minor
>             Fix For: master (8.0)
>
>         Attachments: LUCENE-7996.patch, LUCENE-7996.patch, LUCENE-7996.patch
>
>
> Having worked on MAXSCORE recently, things would be simpler if we required 
> that scores are positive. Practically, this would mean 
>  - forbidding/fixing similarities that may produce negative scores (we have 
> some of them)
>  - forbidding things like negative boosts
> So I'd be curious to have opinions whether this would be a sane requirement 
> or whether we need to be able to cope with negative scores eg. because some 
> similarities that we want to support produce negative scores by design.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to