geekgrrl has asked for the wisdom of the Perl Monks concerning the following question:

I'm just starting out with using Plucene to index my content. It has worked swimmingly well for me so far, except that I don't know that it is using my boost values that I specified in the query string. (Example: qq{keyword:"$term"^2} where carat+value is the boost.)

I think maybe I need to use a scorer, but my attempts last night with those were unsuccessful.

Thanks, Rachel
my $searcher = new Plucene::Search::IndexSearcher($INDEXPATH); my $pquery = $parser->parse($query); #my $bool_scorer = Plucene::Search::BooleanScorer->new; my $hc =Plucene::Search::HitCollector->new( collect => sub { my ($self, $doc, $score) = @_; my $d = $searcher->doc($doc); $results{$d->get('id')->string()} = $score });

Replies are listed 'Best First'.
Re: Plucene Scoring
by nmcfarl (Pilgrim) on Dec 19, 2005 at 23:44 UTC

    So reading the docs for Plucene::Search::Query, it looks like scorers plug into queries. Usually they are baked into subclasses of Query in the _scorer method. The query in turn gets sent into IndexSearcher 's search_top (source) which returns the top scoring results for that query (using that query's scorer).

    But since that does not quite track your code sample, I'm not certain if that's the use case, and thus the info you are looking for