incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: get_score == nan
Date Tue, 06 Apr 2010 18:20:05 GMT
On Tue, Apr 06, 2010 at 11:56:56AM -0500, Peter Karman wrote:
> Is there any legitimate way that $hitdoc->get_score would return a value
> that Perl stringifies to 'nan'? 

When using a SortSpec that doesn't include scoring, yes.  In that case,
SortCollector assigns 'nan' to the MatchDoc score member and it never gets
overwritten with a real value.   We optimize the "score not needed" case and
avoid the cost of calculating scores.

Otherwise, that's unexpected.  

> I am getting that value in some cases. 

> I see in the core code that score is a float. Could there be a type mismatch
> where the C code has more precision than the Perl and Perl is unable to
> stringify the float?

I doubt that's the root of the problem.  In any case, Perl NV SVs use doubles,
so our single precision float scores shouldn't be overflowing.

Marvin Humphrey

View raw message