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

Michael Busch commented on LUCENE-698:
--------------------------------------

> FYI, Nutch uses Query.setBoost(0.0f) to add clauses which affect the 
> set of results but not their ranking. In particular, it uses this to 
> automatically convert query clauses into filters, so that query 
> clauses like "lang:en" can be implemented as cached filters. Note 
> that not all such clauses are so optimized. 

Thanks for the hint, Doug. OK, I understand how you use boost=0.0f in
Nutch. Quite cool and elegant idea actually!

I guess then throwing an IllegalArgumentException in case boost=0 would
break this. The question remains if we should fix the scorers to never
return NaN. Hmm, I'm not completely sure how to do this. Maybe 
DefaultSimilarity.queryNorm() should return 0 instead of Infinity in 
case sumOfSquaredWeights is 0. But then with custom Similarity 
implemenations we could still end up getting NaN.

A different solution of course is to fix it in the scorers itself, to
return a score of 0 in case boost is 0. But then we'd have to add 
checks in the score() and explain() methods, which might be a 
performance overhead.

So I'm not sure if we should "fix" this at all considering these 
difficulties and the fact that nobody complained (I think?) about the 
NaN so far.

Anyway, I'll go ahead and commit LUCENE-698 since this NaN problem is a 
separate issue and not only happing for the FilteredQuery.


> FilteredQuery ignores boost
> ---------------------------
>
>                 Key: LUCENE-698
>                 URL: https://issues.apache.org/jira/browse/LUCENE-698
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.0.0
>            Reporter: Yonik Seeley
>            Assignee: Michael Busch
>            Priority: Minor
>         Attachments: lucene-698.patch
>
>
> Filtered query ignores it's own boost.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to