lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Is negative boost possible?
Date Mon, 12 Oct 2009 21:37:58 GMT
On Mon, Oct 12, 2009 at 12:03 PM, Andrzej Bialecki <ab@getopt.org> wrote:
>> Solr never discarded non-positive hits, and now Lucene 2.9 no longer
>> does either.
>
> Hmm ... The code that I pasted in my previous email uses
> Searcher.search(Query, int), which in turn uses search(Query, Filter, int),
> and it doesn't return any results if only the first clause is present (the
> one with negative boost) even though it's a matching clause.
>
> I think this is related to the fact that in TopScoreDocCollector:48 the
> pqTop.score is initialized to 0, and then all results that have lower score
> that this are discarded. Perhaps this should be initialized to
> Float.MIN_VALUE?

Hmmm, You're actually seeing this with Lucene 2.9?
The HitQueue (subclass of PriorityQueue) is pre-populated with
sentinel objects with scores of -Inf, not zero.

-Yonik
http://www.lucidimagination.com

Mime
View raw message