lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Cosmetic: Getting rid of an extra \n in TFIDFSimilarity.explainScore output
Date Wed, 26 Nov 2014 15:59:26 GMT
Thank you for the patch!  I agree that is annoying.

It makes me a little nervous, losing possibly important explanation
about how that freq itself was computed?

E.g. a PhraseQuery will have "phraseFreq=X" as the explanation for
that freq, telling you this wasn't just a simple term freq ... I
wonder whether other queries want to explain an interesting freq?

Mike McCandless

http://blog.mikemccandless.com


On Wed, Nov 26, 2014 at 10:33 AM, Vanlerberghe, Luc
<Luc.Vanlerberghe@bvdinfo.com> wrote:
> TFIDFSimilarity.explainScore currently outputs an annoying (but harmless of course) extra
\n.
>
> It occurs because the freq argument is included as is in the description of the top Explain
node,
> whereas freq.getValue() is sufficient. The full freq Explain node is included as a detail
further on anyway...
>
> I attached a patch generated with git, but it's just:
> -    result.setDescription("score(doc="+doc+",freq="+freq+"), product of:");
> +    result.setDescription("score(doc="+doc+",freq="+freq.getValue()+"), product of:");
>
> Output like this:
>
>   <lst name="explain">
>     <str name="0-764629">
> 5.5484066 = (MATCH) max of:
>   5.5484066 = (MATCH) weight(titreSearch:camus in 4158) [DefaultSimilarity], result of:
>     5.5484066 = score(doc=4158,freq=1.0 = termFreq=1.0
> ), product of:
>       0.60149205 = queryWeight, product of:
>         9.224405 = idf(docFreq=450, maxDocs=1682636)
>         0.065206595 = queryNorm
>       9.224405 = fieldWeight in 4158, product of:
>         1.0 = tf(freq=1.0), with freq of:
>           1.0 = termFreq=1.0
>         9.224405 = idf(docFreq=450, maxDocs=1682636)
>         1.0 = fieldNorm(doc=4158)
> </str>
>   </lst>
>
> becomes:
>
>   <lst name="explain">
>     <str name="0-764629">
> 5.5484066 = (MATCH) max of:
>   5.5484066 = (MATCH) weight(titreSearch:camus in 4158) [DefaultSimilarity], result of:
>     5.5484066 = score(doc=4158,freq=1.0), product of:
>       0.60149205 = queryWeight, product of:
>         9.224405 = idf(docFreq=450, maxDocs=1682636)
>         0.065206595 = queryNorm
>       9.224405 = fieldWeight in 4158, product of:
>         1.0 = tf(freq=1.0), with freq of:
>           1.0 = termFreq=1.0
>         9.224405 = idf(docFreq=450, maxDocs=1682636)
>         1.0 = fieldNorm(doc=4158)
> </str>
>   </lst>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org

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


Mime
View raw message