lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-901) DefaultSimilarity.queryNorm() should never return Infinity
Date Fri, 01 Jun 2007 19:11:15 GMT

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

Yonik Seeley commented on LUCENE-901:
-------------------------------------

> huh? queryNorm is passed down by BooleanWeight to all of the sub clauses ... am i miss
understanding something?

Sorry, I meant Similarity.queryNorm() is only called at the top level.

> With nested queries, could Float.MAX_VALUE trigger overflow back to Infinity? 

I don't think so... BooleanWeight multiplies the queryNorm by it's boost before calling normalize
on the nested weights (hence if the top-level boost is zero, it will call normalize(0.0f)
on the subweights).
SpanWeight doesn't seem to do nested normalization at all.
Not sure if all the explain implementations would handle it correctly though.

> DefaultSimilarity.queryNorm() should never return Infinity
> ----------------------------------------------------------
>
>                 Key: LUCENE-901
>                 URL: https://issues.apache.org/jira/browse/LUCENE-901
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Michael Busch
>            Priority: Trivial
>
> Currently DefaultSimilarity.queryNorm() returns Infinity if sumOfSquaredWeights=0.
> This can result in a score of NaN (e. g. in TermScorer) if boost=0.0f.
> A simple fix would be to return 1.0f in case zero is passed in.
> See LUCENE-698 for discussions about this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message