[Kinosearch] boosting doc score based on integer data

Dermot paikkos at googlemail.com
Sun Nov 9 13:23:00 PST 2008



Hi,

Version 0.20_051

I am starting out with with KinoSearch. The tutorials have given me a
good start but I have a feature that I am not able to get working.

I have a integer field (sales), it's the number of sales a doc has
had. I don't want to sort the hits by this field so sort_spec is not
the solution. I would like to use the integer value to moderate the
final results. In effect, if a doc has 0 sales, it would get a boost
of 0.8 and those docs with 5+ would get a 1.2 boost.

I have stored and indexed the field and it isn't being analyzed. I'm
not clear on how to proceed after that. Do I need to create a custom
Compiler/Query/Scorer?

A little guidance would be much appreciated. There are a lot of docs
under KS::Search but I am not sure how to mould a custom
Query-to-Scorer compiler or if that is the best path for me to take.

TIA,
Dp.



package MySearch::Sales;
use base qw( KinoSearch::FieldSpec );

sub analyzed     { 0 }
sub indexed      { 1 }
sub stored       { 1 }

1;

package MySearch;
use base qw( KinoSearch::Schema );

our %fields = (
        title                   => 'text',
        number               => 'text',
        caption                 => 'text',
        EN_keywords         => 'text',
        sales               => 'MySearch::Sales',
);
1;





More information about the kinosearch mailing list