You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2005/10/11 17:58:05 UTC

[jira] Created: (LUCENE-451) BooleanQuery explain with boost==0

BooleanQuery explain with boost==0
----------------------------------

         Key: LUCENE-451
         URL: http://issues.apache.org/jira/browse/LUCENE-451
     Project: Lucene - Java
        Type: Bug
  Components: Search  
    Versions: CVS Nightly - Specify date in submission    
    Reporter: Yonik Seeley
    Priority: Minor


BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").

I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 

Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-451?page=all ]
     
Hoss Man resolved LUCENE-451:
-----------------------------

    Resolution: Fixed

With the code from LUCENE-605 all tests pass (and have been commited)

> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Assignee: Hoss Man
>     Priority: Minor
>  Attachments: bq.containing.clause.with.zero.boost.tests.patch, bq.containing.clause.with.zero.boost.tests.patch, bq.containing.clause.with.zero.boost.tests.patch
>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "paul.elschot (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LUCENE-451?page=comments#action_12331818 ] 

paul.elschot commented on LUCENE-451:
-------------------------------------

I fully agree, but IndexSearcher.java at line 107 does not conform,
it will only provide a hit when its score is positive.

Implementing Explanation.matched() could be more than a bit of work, because
many existing explain() methods will be need to be adapted.
Explanation.setMatched() would also be needed, although such a flag
could be set to true by default.

Regards,
Paul Elschot.


> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug
>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Priority: Minor

>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-451?page=all ]

Hoss Man updated LUCENE-451:
----------------------------

    Attachment: bq.containing.clause.with.zero.boost.tests.patch

a revised version of hte previous tst patch ... this fixes a lot of the things that made the tests "invalid" before -- cheifly by:
  1) using a Similarity that doesn't choke on boosts of 0.0
  2) using a HitCollector to check matching (which is neccessary when matching docs have scores of 0)

..also in this patch is a tweak to the way the expected results are tested -- first by looking at the set of matching documents *then* look at the explanations for those documents (which makes it obvious when your assumptions about what matches are wrong before you look at why the explanation doesn't equal what it should)

> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Assignee: Hoss Man
>     Priority: Minor
>  Attachments: bq.containing.clause.with.zero.boost.tests.patch, bq.containing.clause.with.zero.boost.tests.patch
>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-451?page=all ]

Hoss Man updated LUCENE-451:
----------------------------

    Attachment: bq.containing.clause.with.zero.boost.tests.patch

some test cases demonstrating discrepencies when a BooleanQuery has clauses of various types with boosts of 0.0.  Some of these test cases may not be things we really want to commit (since the score is "NaN") but they still serve as a good example for the problem.

(much of this patch is modified from some other tests I had orriginally attached to LUCENE-557 but did not commit)

> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Assignee: Hoss Man
>     Priority: Minor
>  Attachments: bq.containing.clause.with.zero.boost.tests.patch
>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-451?page=all ]

Hoss Man updated LUCENE-451:
----------------------------

    Attachment: bq.containing.clause.with.zero.boost.tests.patch

slight bug in test2 - the old method of checking the results using Hits had a differnet set of matching docs because of negatively scoring matches.  This version makes sense when using a HitCollector.

> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Assignee: Hoss Man
>     Priority: Minor
>  Attachments: bq.containing.clause.with.zero.boost.tests.patch, bq.containing.clause.with.zero.boost.tests.patch, bq.containing.clause.with.zero.boost.tests.patch
>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (LUCENE-451) BooleanQuery explain with boost==0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-451?page=all ]

Hoss Man reassigned LUCENE-451:
-------------------------------

    Assign To: Hoss Man

> BooleanQuery explain with boost==0
> ----------------------------------
>
>          Key: LUCENE-451
>          URL: http://issues.apache.org/jira/browse/LUCENE-451
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>     Reporter: Yonik Seeley
>     Assignee: Hoss Man
>     Priority: Minor

>
> BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
> If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply  Explanation(0.0f, "match required").
> I'm not sure what the correct fix is here.  I don't think it can be done based on score alone, since that isn't how scorers work.   Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be? 
> Related to the problem above, even if no boosts are zero, it it sometimes nice to know *why* a particular query failed to match.  It would mean a longer explanation, but maybe we should include non matching explains too?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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