lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen (JIRA)" <>
Subject [jira] Commented: (LUCENE-1302) explain should not mask negative scores
Date Tue, 10 Jun 2008 16:28:45 GMT


Doron Cohen commented on LUCENE-1302:

Hoss, thanks for the pointer to LUCENE-605. 

    :: Still it would disturb to declare a "negative score" as a "match".

    ... no idea what you ment there.

Assume a boolean query that contains a BTQ, among other things.
The score of a doc is a sum over several scores, all elements are positive, except the BTQ
element which is negative.
The total sum is positive and hence (say) was accepted by the collector in effect. 
As the code is right now, the explanation for the boolean query would ignore the (negative)
BTQ part and its value would differ that of the actual search. 

Fixing BTQ to return a complex explanation and calling setMatch(True) will fix the score difference,
and now the BQ explanation would also contain the sub-expl of the BTQ. Great. This also makes
perfect sense in BTQ, because the way the score is computed, it can be negative or even 0.
I'll open a separate issue for fixing BTQ.

The one thing that bothers me still is that the BTQ sub-expl would print as MATCH when in
fact it just hurts the current doc score (apparently "not enough"). Would it be more correct
for the (negative) BTQ part to say "NON-MATCH"?

> explain should not mask negative scores
> ---------------------------------------
>                 Key: LUCENE-1302
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Query/Scoring
>            Reporter: Doron Cohen
>            Assignee: Doron Cohen
>            Priority: Minor
>             Fix For: 2.4
>         Attachments: lucene-1302-explain-negative.patch
> Explanation.isMatch() returns false for 0 or negative scores. 
> Hence negative scores are omitted from the explanation.
> This causes, when using e.g. BoostingTermQuery with negative boosts, a difference between
the collected doc score and the score shown by explain().  
> A word on the usage of this - BTQ with negative boosts is useful for "punishing" documents
for containing a term. It also allows all sorts of tricks with multiplying query boost by
the BTQ boost, so you get a positive score if both boosts have the same sign but negative
otherwise. - I am sure there other uses as well.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message