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

Terry Smith commented on LUCENE-6446:
-------------------------------------

bq. I removed it because it was not always in the summary (only when using 
ComplexExplanation) as well as redundant with the description which is explicit 
when there is no match, for instance TermWeight's "no matching term" or 
BooleanWeight "no match on required clause"?

That makes sense. Removing the redundant information is definitely the way to 
go.


I also noticed that the new Explanation.noMatch() methods look a little trappy. 
They both take the child details and drop them on the floor.

{code}
  public static Explanation noMatch(String description, Collection<Explanation> 
details) {
    return new Explanation(false, 0f, description, Collections.emptyList());
  }
{code}

I think the noMatch() methods should either add the details to the created 
explanation or not accept them as parameters. Having a non-matching explanation 
contain child details can be really useful for complex queries. What do you 
think?



> Simplify Explanation API
> ------------------------
>
>                 Key: LUCENE-6446
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6446
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>             Fix For: Trunk, 5.2
>
>         Attachments: LUCENE-6446.patch
>
>
> We should make this API easier to consume, for instance:
>  - enforce important components to be non-null (eg. description)
>  - decouple entirely the score computation from whether there is a match or 
> not (Explanation assumes there is a match if the score is > 0, you need to 
> use ComplexExplanation to override this behaviour)
>  - return an empty array instead of null when there are no "details"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to