[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kinosearch
Subject:    [KinoSearch] Retrieving $doc->set_boost() value at search time
From:       marvin () rectangular ! com (Marvin Humphrey)
Date:       2006-10-30 10:48:21
Message-ID: E5BC3C63-7C2F-4B72-9007-3BAE8A10688D () rectangular ! com
[Download RAW message or body]


On Oct 27, 2006, at 1:58 AM, henka@cityweb.co.za wrote:

> Given the following code which is used during index-time:
>
> $doc->set_boost($boost_val);
>
> Is there any way to retrieve this $boost_value value during search- 
> time
> for debugging purposes?

There is not.  The boost information is not stored along with the  
document.  It's factored into the calculation of each term's "norm",  
which ends up as custom 8-bit float with a 3 bit mantissa and a 5 bit  
exponent, for about 1 decimal digit of precision.  You can't get the  
document boost back, unless you store it as its own field.

> I tried:
>
> while ( my $hit = $hits->fetch_hit_hashref ) {
>   my $doc = $hit->get_doc;
>   my $boost = $doc->get_boost;
>   ...
>
> Which produces this error:
>
> "Can't call method "get_doc" on unblessed reference at..."

You get that error because you're using the convenience method $hits- 
 >fetch_hit_hashref, instead of $hits->fetch_hit.  However, even if  
you did get a real Doc object via a real Hit object, it wouldn't  
provide you with an accurate number for get_boost.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic