You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Christian Ziech (JIRA)" <ji...@apache.org> on 2018/12/12 11:57:00 UTC

[jira] [Comment Edited] (LUCENE-8606) ConstantScoreQuery looses explain details of wrapped query

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

Christian Ziech edited comment on LUCENE-8606 at 12/12/18 11:56 AM:
--------------------------------------------------------------------

Sure I would be happy to supply a change but I think I'd first like to agree on an approach. The main challenge is imo that the ConstantScoreWeigth is subclassed at a lot of places in- and outside of lucene and changing the Constructor signature would be possibly problematic.
So I'd add another constructor that would pass in the wrapped Weigth. So the behavior would be improved if the wrapped weight is passed in, and would remain unchanged if that weight is missing. 
A fix that changes all usages of the ConstantScoreWeigth is possible too but that would break compatibility (as I'd replace the Query parameter with a Weight parameter instead of just adding an alternative constructor) ...


was (Author: christianziech):
Sure I would be happy to supply a change but I think I'd first like to agree on an approach. The main challenge is imo that the ConstantScoreWeigth is subclassed at a lot of places in an outside of lucene and changing the Constructor signature would be possibly problematic.
So I'd add another constructor that would pass in the wrapped Weigth. So the behavior would be improved if the wrapped weight is passed in, and would remain unchanged if that weight is missing. 
A fix that changes all usages of the ConstantScoreWeigth is possible too but that would break compatibility (as I'd replace the Query parameter with a Weight parameter instead of just adding an alternative constructor) ...

> ConstantScoreQuery looses explain details of wrapped query
> ----------------------------------------------------------
>
>                 Key: LUCENE-8606
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8606
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Christian Ziech
>            Priority: Major
>
> Right now the ConstantScoreWeigth used by the ConstantScoreQuery is not adding the details of the wrapped query to the explanation. 
> {code}
> if (exists) {
>     return Explanation.match(score, getQuery().toString() + (score == 1f ? "" : "^" + score));
> } else {
>     return Explanation.noMatch(getQuery().toString() + " doesn't match id " + doc);
> }
> {code}
> This is kind of inconvenient as it makes it kind of hard to figure out which term finally really matched when one e.g. puts a BooleanQuery into the FILTER clause of another BooleanQuery.



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

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