[
https://issues.apache.org/jira/browse/LUCENE-8012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16289510#comment-16289510
]
Adrien Grand commented on LUCENE-8012:
--------------------------------------
I like the change! Some suggestions:
- Maybe require that the value is non null in Explanation.match?
- In tests, we should probably either use the Number directly for the
comparision whenever possible, or when it is not convenient at least use the
doubleValue() in order to make sure that the explanation returned exactly the
same score and not a double that rounds to the same float as the score?
- We should review all implementations of DoubleValuesSource.explain to make
sure they return a Double and not a Float. For instance ConstantValuesSource
still casts its value to a float.
> Improve Explanation class
> -------------------------
>
> Key: LUCENE-8012
> URL: https://issues.apache.org/jira/browse/LUCENE-8012
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Robert Muir
> Labels: newdev
> Attachments: LUCENE-8012.patch
>
>
> Explanation class is currently nice and simple, and float matches the scoring
> api, but this does not work well for debugging numerical errors of internal
> calculations (it usually makes practical sense to use 64-bit double to avoid
> issues).
> Also it makes for nasty formatting of integral values such as number of
> tokens in the collection or even document's length, its just noise to see
> {{10.0}} there instead of {{10}}, and scientific notation for e.g. number of
> documents is just annoying.
> One idea is to take Number instead of float? Then you could pass in the
> correct numeric type (int,long,double,float) for internal calculations,
> parameters, statistics, etc, and output would look nice.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]